PHP Sigfox Client

Exception Handling

There are four types of exceptions throwing from the API client library. And all the exceptions extended to SigfoxException class. So you can catch all the exceptions that throwing from this client library by this exception class.

  1. Serialization & Deserialization Exceptions These exceptions throwing when you or the Sigfox server pass a different typed value than the expected value. DeserializationException is throwing when a user input array or a server returned response converting to objects. SerializeExceptions is throwing when a object converting to an array. You can get the expected type name as a string by getExpectedType method and actual type name by the getActualType method. SerializeException API Reference DeserializeException API Reference
  2. Validation Exceptions There are some validations for parameters in the sigfox API documentation. Validation Exceptions throwing if you provide an invalid value according to these validation rules. You can get the invalid value by getValue method and validation rule by getRule method. ValidationException API Reference
  3. Response Exceptions These exceptions throwing when the server returned an HTTP error code. You can catch all HTTP errors by ResponseException class. Use below exceptions if you want to catch only specific error codes.
  4. Unexpected Response Exception When the server returned an error code that not mentioned in the documentation. But you can not catch it using
    the ResponseException .

Next:- File Downloads

Search results