Improve an exception handling in the Location class