aboutsummaryrefslogtreecommitdiff
path: root/pkg/config/error.go
diff options
context:
space:
mode:
authorJulien Dessaux2021-04-06 16:46:05 +0200
committerJulien Dessaux2021-04-06 16:46:05 +0200
commit92c5e1e4d073c82e12e26170379cb5c8d90ab2e8 (patch)
treed862f6ea5a3f22c6c8ad268c7ddf5bb2536fa95c /pkg/config/error.go
parentAdded a flag to specify a configuration file and wrote a proper readme (diff)
downloadtrains-92c5e1e4d073c82e12e26170379cb5c8d90ab2e8.tar.gz
trains-92c5e1e4d073c82e12e26170379cb5c8d90ab2e8.tar.bz2
trains-92c5e1e4d073c82e12e26170379cb5c8d90ab2e8.zip
Added trainStop config parameter which was wrongly hardcoded
Diffstat (limited to 'pkg/config/error.go')
-rw-r--r--pkg/config/error.go15
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,
+ }
+}