Skip to content

Display a friendlier error message when running outside the UKΒ #179

@abhidg

Description

@abhidg

Currently CATS fails with unknown location if we supply a non-UK postcode (example shown is for Mountain View, CA, USA). This can happen if CATS is run outside the UK as ipapi.co returns the local postcode.

at 16:20 > cats --loc 94043 -d 30

The.____ ..... __ .... ________ . ______...
.. /  __)...../  \....(__    __).)  ____)....
..|  /......./    \......|  |...(  (___........
..| |limate./  ()  \ware.|  |ask.\___  \cheduler
..|  \__...|   __   |....|  |....____)  )....
...\    )..|  (..)  |....|  |...(      (..

WARNING:root:config file not found
WARNING:root:Unspecified carbon intensity forecast service, using carbonintensity.org.uk
Warning: truncating postcode 94043 to 94.
ERROR:root:Error: unknown location 94043

ERROR:root:Location should be be specified as the outward code,
for example 'SW7' for postcode 'SW7 EAZ'.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions