@andersonalmeidax0/webcomponents 0.1.23 → 0.1.24

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.
package/RestAPIAdapter.js CHANGED
@@ -120,8 +120,8 @@ class RestAPIAdapter {
120
120
  var r = null;
121
121
  r = await response.json();
122
122
  if (this.DEBUG_APIFETCH) alert(JSON.stringify(r, null, 2));
123
- if (r.error)
124
- throw new PlatAPIReturnCodeError(r.error.message);
123
+ //if (r.error)
124
+ // throw new PlatAPIReturnCodeError(r.error.message);
125
125
  return r;
126
126
  }
127
127
  /** ***********************
@@ -139,14 +139,18 @@ class RestAPIAdapter {
139
139
  url = (this.urlServer == null) ? url : this.urlServer + url;
140
140
 
141
141
  const response = await this.myFetch3(ptoken, url, method, body);
142
+ alert(response.status)
142
143
  if (!response.ok) {
144
+ alert("callapi staatu:"+response.status)
145
+ r = await this.getJSONResponse(response);
146
+ alert("callapi ret err:"+JSON.stringify(r));
143
147
  if (response.status === 404)
144
- throw new PlatAPIDBNotFound(`An error has occured: ${response.status}`);
148
+ throw new PlatAPIDBNotFound(`An error has occured: ${response.status}`+' message:'+JSON.stringify(r));
145
149
  if (response.status === 403)
146
- throw new PlatAPIForbidden(`An error has occured: ${response.status}`);
150
+ throw new PlatAPIForbidden(`An error has occured: ${response.status}`+' message:'+JSON.stringify(r));
147
151
  if (response.status === 401)
148
- throw new PlatAPIAuthError(`An error has occured: ${response.status}`);
149
- throw new PlatAPIReturnCodeError();
152
+ throw new PlatAPIAuthError(`An error has occured: ${response.status}`+' message:'+JSON.stringify(r));
153
+ throw new PlatAPIReturnCodeError(`An error has occured: ${response.status}`+' message:'+JSON.stringify(r));
150
154
  }
151
155
  r = await this.getJSONResponse(response);
152
156
 
@@ -5,12 +5,9 @@ export class ErrorCard extends React.Component {
5
5
  return (
6
6
  <div className="g--10 m--2">
7
7
  <h3>Erro de sistema inesperado. Entre em contato com suporte e informe a mensagem abaixo:</h3>
8
- <h4>{JSON.stringify(this.props.myException)}</h4>
9
- <h4>{JSON.stringify(this.props.myException.stack)}</h4>
10
- <div className="card g--10 m--0">
11
- <div> <div className=""> <p> <a href='/loginExternal'>Entrar novamente.</a> </p> </div> <span> </span>
12
- </div>
13
- </div>
8
+ <h4>Error name:{(this.props.myException.name)}</h4>
9
+ <h4>Error message:{(this.props.myException.message)}</h4>
10
+ <h4>Error Stack:{(this.props.myException.stack)}</h4>
14
11
  </div>
15
12
  );
16
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andersonalmeidax0/webcomponents",
3
- "version": "0.1.23",
3
+ "version": "0.1.24",
4
4
  "description": "webcomponents",
5
5
  "main": "webcomponents",
6
6
  "scripts": {
package/releasenotes.txt CHANGED
@@ -1,3 +1,5 @@
1
+ WebComponents
2
+
1
3
  0.1.0: beta
2
4
  0.1.1: add all components
3
5
  0.1.2: with text labels for buttons
@@ -15,6 +17,7 @@
15
17
  0.1.15: fix bug
16
18
  0.1.16: fix bug2
17
19
  0.1.23: fix bugs
20
+ 0.1.24: show errors
18
21
 
19
22
  npm login
20
23
  npm publish --access public