I'm trying to throw an error. I tried
raise newOSError(13, "Unknown opcode:" )
but I'm getting
Error: type mismatch: got <int literal(13), string>
but expected one of:
proc newOSError(errorCode: OSErrorCode; additionalInfo = ""): owned(ref OSError)
first type mismatch at position: 1
required type for errorCode: OSErrorCode
but expression '13' is of type: int literal(13)
I don't know what I should do.
Ah, OK, I figured it out:
raise newException(OSError, "Unkown opcode")