@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 +10 -6
- package/jzcomponents/ErrorCard.jsx +3 -6
- package/package.json +1 -1
- package/releasenotes.txt +3 -0
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
|
-
|
|
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>{
|
|
9
|
-
<h4>{
|
|
10
|
-
<
|
|
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
package/releasenotes.txt
CHANGED