@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 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
- alert(response.status)
142
+ // alert(response.status)
143
143
  if (!response.ok) {
144
- alert("callapi staatu:"+response.status)
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:{JSON.stringify(this.props.myException.stack)}</h4>
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andersonalmeidax0/webcomponents",
3
- "version": "0.1.26",
3
+ "version": "0.1.28",
4
4
  "description": "webcomponents",
5
5
  "main": "webcomponents",
6
6
  "scripts": {
package/releasenotes.txt CHANGED
@@ -17,7 +17,7 @@ WebComponents
17
17
  0.1.15: fix bug
18
18
  0.1.16: fix bug2
19
19
  0.1.23: fix bugs
20
- 0.1.26: show errors / show stack
20
+ 0.1.28: show errors / show stack unescape
21
21
 
22
22
  npm login
23
23
  npm publish --access public