UNPKG
netsuite-api-client
Version:
latest (1.0.3)
1.0.3
1.0.2
1.0.1
1.0.0
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0
0.0.4
0.0.3
0.0.2
0.0.1
Netsuite client for REST interface
github.com/julbrs/netsuite-api-client
julbrs/netsuite-api-client
netsuite-api-client
/
dist
/
errors.js
14 lines
(13 loc)
•
372 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
export
class
NetsuiteError
extends
Error
{
constructor
(
httpError
) {
try
{
const
body = httpError?.
response
?.
body
;
const
data =
JSON
.
parse
(body);
const
text = data[
"o:errorDetails"
][
0
].
detail
;
super
(text || httpError.
message
); }
catch
(e) {
super
(httpError.
message
); } } }