2022-01-04 12:21:08 +03:00
|
|
|
// Copyright (c) 2019-2022 Alexander Medvednikov. All rights reserved.
|
2021-10-19 16:03:45 +03:00
|
|
|
// Use of this source code is governed by an MIT license
|
|
|
|
// that can be found in the LICENSE file.
|
|
|
|
module time
|
|
|
|
|
|
|
|
pub struct TimeParseError {
|
2022-02-11 16:52:33 +03:00
|
|
|
Error
|
2021-10-19 16:03:45 +03:00
|
|
|
code int
|
|
|
|
}
|
|
|
|
|
2022-02-11 16:52:33 +03:00
|
|
|
pub fn (err TimeParseError) msg() string {
|
|
|
|
return 'Invalid time format code: $err.code'
|
|
|
|
}
|
|
|
|
|
2021-10-19 16:03:45 +03:00
|
|
|
fn error_invalid_time(code int) IError {
|
|
|
|
return TimeParseError{
|
|
|
|
code: code
|
|
|
|
}
|
|
|
|
}
|