fix: resolve browser issue with Error.captureStackTrace (#1663)

* fix webpacking error issue

* fix eslint comment
This commit is contained in:
Mayukha Vadari
2021-09-24 15:18:48 -04:00
parent 0996dc13b7
commit da92bb7f1a

View File

@@ -20,7 +20,10 @@ class XrplError extends Error {
this.name = this.constructor.name
this.message = message
this.data = data
Error.captureStackTrace(this, this.constructor)
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- `captureStackTrace` can be null in browsers
if (Error.captureStackTrace != null) {
Error.captureStackTrace(this, this.constructor)
}
}
/**