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