UNPKG

netsuite-api-client

Version:
14 lines (13 loc) 372 B
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); } } }