types: Status: improve parsing and error reporting
This commit is contained in:
parent
cceeffe737
commit
06371bd542
|
@ -5,8 +5,8 @@ struct Status
|
|||
|
||||
# FIXME: error codes
|
||||
function Status(ma::Char, mi::Char, meta::String)
|
||||
'1' <= ma <= '6' || throw("Invalid")
|
||||
'0' <= mi <= '9' || throw("Invalid")
|
||||
'1' <= ma <= '6' || throw("Invalid: first status out of range")
|
||||
isnumeric(mi) || throw("Invalid: second status not a number")
|
||||
if length(meta) > 1024
|
||||
throw("Invalid")
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue