CelsiusNetwork / celsius-js-sdk

Celsius JavaScript SDK provides an easy and secure way to communicate with the Celsius API.
https://developers.celsius.network
Apache License 2.0
24 stars 22 forks source link

Cryptic error message when Celsius Server is down #46

Open robertkowalski opened 4 years ago

robertkowalski commented 4 years ago

Describe the bug When the Celsius server is down, we receive the error The "signature" argument must be one of type string, Buffer, TypedArray, or DataView. Received type undefined -- because JSON parsing failed.

Stack Trace

The "signature" argument must be one of type string, Buffer, TypedArray, or DataView. Received type undefined

To Reproduce Steps to reproduce the behavior:

  1. Your nginx shows an error html instead of JSON
  2. Connect with JS client SDK
  3. Get cryptic error

Expected behavior An error message mentioning that the remote server is unavailable. Maybe a 500 type error.

Additional context A good error message helps to find and debug errors a lot easier and increases therefore adoption of the software.