From 92c5e1e4d073c82e12e26170379cb5c8d90ab2e8 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Tue, 6 Apr 2021 16:46:05 +0200 Subject: Added trainStop config parameter which was wrongly hardcoded --- pkg/config/error.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'pkg/config/error.go') 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, + } +} -- cgit v1.2.3