Allways use error (not throw) in the api.