1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/examples/errors.v
2021-03-29 11:17:00 +02:00

21 lines
328 B
V

import semver
fn main() {
semver.from('asd') or { check_error(err) }
semver.from('') or { check_error(err) }
}
fn check_error(err IError) {
match err {
semver.InvalidVersionFormatError {
println('wrong format')
}
semver.EmptyInputError {
println('empty input')
}
else {
println('unknown error')
}
}
}