@laboratoria/sdk-js 2.0.0-alpha.2 → 2.0.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/client.js +2 -1
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -14,8 +14,9 @@ export const createClient = (baseUrl, authUser) => async (url, opts = {}) => {
14
14
  const body = await resp.json();
15
15
 
16
16
  if (resp.status > 202) {
17
- throw Object.assign(new Error(`HTTP Error ${resp.status}`), {
17
+ throw Object.assign(new Error(body?.message || `HTTP Error ${resp.status}`), {
18
18
  status: resp.status,
19
+ code: body?.code,
19
20
  body,
20
21
  });
21
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@laboratoria/sdk-js",
3
- "version": "2.0.0-alpha.2",
3
+ "version": "2.0.0-alpha.3",
4
4
  "description": "Laboratoria JavaScript (browser) SDK",
5
5
  "scripts": {
6
6
  "test": "jest --verbose --coverage",