@andersonalmeidax0/webcomponents 0.1.26 → 0.1.28
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 +7 -7
- package/jzcomponents/ErrorCard.jsx +8 -1
- package/package.json +1 -1
- package/releasenotes.txt +1 -1
package/RestAPIAdapter.js
CHANGED
|
@@ -139,18 +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
|
-
|
|
142
|
+
// alert(response.status)
|
|
143
143
|
if (!response.ok) {
|
|
144
|
-
|
|
144
|
+
// alert("callapi staatu:"+response.status)
|
|
145
145
|
r = await this.getJSONResponse(response);
|
|
146
|
-
alert("callapi ret err:"+(r));
|
|
146
|
+
//alert("callapi ret err:"+JSON.stringify(r));
|
|
147
147
|
if (response.status === 404)
|
|
148
|
-
throw new PlatAPIDBNotFound(`An error has occured: ${response.status}`+' message:'+(r));
|
|
148
|
+
throw new PlatAPIDBNotFound(`An error has occured: ${response.status}`+' message:'+JSON.stringify(r));
|
|
149
149
|
if (response.status === 403)
|
|
150
|
-
throw new PlatAPIForbidden(`An error has occured: ${response.status}`+' message:'+(r));
|
|
150
|
+
throw new PlatAPIForbidden(`An error has occured: ${response.status}`+' message:'+JSON.stringify(r));
|
|
151
151
|
if (response.status === 401)
|
|
152
|
-
throw new PlatAPIAuthError(`An error has occured: ${response.status}`+' message:'+(r));
|
|
153
|
-
throw new PlatAPIReturnCodeError(`An error has occured: ${response.status}`+' message:'+(r));
|
|
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));
|
|
154
154
|
}
|
|
155
155
|
r = await this.getJSONResponse(response);
|
|
156
156
|
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
|
|
3
|
+
function slashUnescape(contents) {
|
|
4
|
+
return contents.replace(/\\(\\|n|")/g, function(replace) {
|
|
5
|
+
return replacements[replace];
|
|
6
|
+
});
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
|
|
3
10
|
export class ErrorCard extends React.Component {
|
|
4
11
|
render() {
|
|
5
12
|
return (
|
|
@@ -7,7 +14,7 @@ export class ErrorCard extends React.Component {
|
|
|
7
14
|
<h3>Erro de sistema inesperado. Entre em contato com suporte e informe a mensagem abaixo:</h3><hr/>
|
|
8
15
|
<h4>Error name:{(this.props.myException.name)}</h4><hr/>
|
|
9
16
|
<h4>Error message:{(this.props.myException.message)}</h4><hr/>
|
|
10
|
-
<h4>Error Stack
|
|
17
|
+
<h4>Error Stack:<code>{JSON.stringify(slashUnescape(this.props.myException.stack))}</code></h4>
|
|
11
18
|
</div>
|
|
12
19
|
);
|
|
13
20
|
}
|
package/package.json
CHANGED