Errors - realtime-trains-lang/realtime-trains-py GitHub Wiki
Errors
[!IMPORTANT]
We're looking to update this page in the near future. Keep an eye out for a release around improved error handling.
When running realtime-trains-py, you might run into some errors. Here, we've provided a list of errors you might encounter and how to fix them.
They're all arranged in alphabetical order, so you shouldn't have trouble finding them. You can also search for the error using Ctrl + F (on Windows and Linux) or Cmd ⌘ + F (on Mac).
Access Blocked
Exception: 401: Access blocked. Check your credentials.
or
Exception: 403: Access blocked. Check your credentials.
This error is extremely unlikely to come up. If you experience this error, it might be a problem with your authentication details.
This error means that the credentials you provided when you initialised the package were unable to be verified by the API server. If your credentials are correct and you are unable to access the API, you should contact the API support via the api portal. This error is unlikely to be a problem with realtime-trains-py.
If you have recently registered, it may take a while for your details to be verified before you can access the API. If this problem persists, visit the api portal for support. You can also report an issue with realtime-trains-py on GitHub so that we can check our system for any issues.
An Error Occurred
Exception: 500: An error occurred while fetching service data. This is likely because the API response didn't provide the desired data.
or
Exception: 500: An unexpected error occurred handling your request. Try again in a few minutes.
This error means that there's been a problem on the API side, or realtime-trains-py tried to get non-existent data. Double check your spelling and the data you requested. If this problem persists, report an issue with realtime-trains-py on GitHub so that we can check our systems.
Make sure you read the documentation if you're unsure.
Complexity not Recognised
ValueError: 400: Complexity not recognised. Select a valid type.
This error means that you didn't select a valid complexity type when you initialised the package. Make sure you read the setup guide before running your code.
If this problem persists and you have correctly followed the setup guide, report an issue with realtime-trains-py on GitHub so that we can check our systems.
Couldn't Verify your Username or Password.
PermissionError: 401: Couldn't verify your username or password. Check your details and try again.
This error means that you didn't pass in a username and a password when you initialised the package. Make sure you read the setup guide before running your code.
If this problem persists and you have correctly followed the setup guide, report an issue with realtime-trains-py on GitHub so that we can check our systems.
Failed to Connect
Exception: (error_code) Failed to connect to the RTT API server. Try again in a few minutes.
This error means that there's been a problem on the API side. Double check your spelling and the data you requested. If this problem persists, report an issue with realtime-trains-py on GitHub so that we can check our systems.
Make sure you read the documentation if you're unsure.
Invalid Date
ValueError: 400: Invalid date. The date provided did not meet requirements or fall into the valid date range.
This error means that a date you provided was not accepted by the system. Your date should be provided in the form yyyy/mm/dd.
Make sure you read the documentation if you're unsure.
[!WARNING] Dates requested that are more than two weeks after the current date are unlikely to be representative or accurate of the timetable on that day.
Invalid Time
ValueError: 400: Invalid time. The time provided did not meet requirements or fall into the valid time range.
This error means that a date you provided was not accepted by the system. Your date should be provided in the form yyyy/mm/dd.
Make sure you read the documentation if you're unsure.
Missing Authentication Details
ValueError: 400: Missing authentication details. Both username and password must be provided. Not all required fields were provided.
This error means that you didn't pass in a username and a password when you initialised the package. Make sure you read the setup guide before running your code.
If this problem persists and you have correctly followed the setup guide, report an issue with realtime-trains-py on GitHub so that we can check our systems.
No Data Found
Exception: 404: The data you requested could not be found.
or
ValueError: 404: No data found.
This error means that the API didn't provide the data you requested. Try checking your spelling and double check the data you requested.
Make sure you read the documentation if you're unsure.
Service Type Not Recognised
Exception: 501: The service type of this service wasn't recognised.
This error means that the service type wasn't validated correctly. If you're requesting a ship departure, it won't be handled by realtime-trains-py as we currently don't support ship departures. Double check your spelling and the data you requested. If this problem persists, report an issue with realtime-trains-py on GitHub so that we can check our systems.
Make sure you read the documentation if you're unsure.
Service UID not Recognised
ValueError: 400: Invalid Service UID. The service UID provided did not meet requirements or fall into the valid range.
This error means that the Service UID you entered doesn't match any service on the server. The Service UID should be a 6-character string. It should start with one letter (not case-sensitive) followed by five integers. For example: G54072 - which is the Service UID for 9J35. The package will return the error shown above if you provide the headcode (9J35 in this case). Due to API limitations, Service UIDs must be provided instead.
Make sure you read the documentation if you're unsure.