Files
callstack__react-native-tes…/src/helpers/errors.js
T
Michał Pierzchała 235942bee3 fix(breaking): correct faulty implementation of finding by name (#62)
* fix(breaking): correct faulty implementation of finding by name

* chore: update docs

* refactor: code review
2018-11-17 19:13:44 +01:00

17 lines
416 B
JavaScript

// @flow
export class ErrorWithStack extends Error {
constructor(message: ?string, callsite: Function) {
super(message);
if (Error.captureStackTrace) {
Error.captureStackTrace(this, callsite);
}
}
}
export const createLibraryNotSupportedError = (error: Error) =>
new Error(
`Currently the only supported library to search by text is "react-native".\n\n${
error.message
}`
);