diff options
author | Julien Dessaux | 2021-04-06 16:46:05 +0200 |
---|---|---|
committer | Julien Dessaux | 2021-04-06 16:46:05 +0200 |
commit | 92c5e1e4d073c82e12e26170379cb5c8d90ab2e8 (patch) | |
tree | d862f6ea5a3f22c6c8ad268c7ddf5bb2536fa95c /pkg/config/error.go | |
parent | Added a flag to specify a configuration file and wrote a proper readme (diff) | |
download | trains-92c5e1e4d073c82e12e26170379cb5c8d90ab2e8.tar.gz trains-92c5e1e4d073c82e12e26170379cb5c8d90ab2e8.tar.bz2 trains-92c5e1e4d073c82e12e26170379cb5c8d90ab2e8.zip |
Added trainStop config parameter which was wrongly hardcoded
Diffstat (limited to '')
-rw-r--r-- | pkg/config/error.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/pkg/config/error.go b/pkg/config/error.go index c49b6a9..41a323c 100644 --- a/pkg/config/error.go +++ b/pkg/config/error.go @@ -90,3 +90,18 @@ func newInvalidTokenError(token string) error { token: token, } } + +// Invalid trainStop field error +type InvalidTrainStopError struct { + trainStop string +} + +func (e *InvalidTrainStopError) Error() string { + return fmt.Sprintf("Invalid trainStop %s : it must be a string that lookslike \"stop_area:SNCF:87723502\" (make sure to quote the string because of the colon characters)", e.trainStop) +} + +func newInvalidTrainStopError(trainStop string) error { + return &InvalidTrainStopError{ + trainStop: trainStop, + } +} |