{\itshape Error} instance\hypertarget{md_sfcode_node_modules_ext_node_modules_type_docs_error_autotoc_md9940}{}\doxysection{$<$tt$>$error/is$<$/tt$>$}\label{md_sfcode_node_modules_ext_node_modules_type_docs_error_autotoc_md9940}
Confirms if given object is a native error object


\begin{DoxyCode}{0}
\DoxyCodeLine{const isError = require("{}type/error/is"{});}
\DoxyCodeLine{}
\DoxyCodeLine{isError(new Error()); // true}
\DoxyCodeLine{isError(\{ message: "{}Fake error"{} \}); // false }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_ext_node_modules_type_docs_error_autotoc_md9941}{}\doxysection{$<$tt$>$error/ensure$<$/tt$>$}\label{md_sfcode_node_modules_ext_node_modules_type_docs_error_autotoc_md9941}
If given argument is an error object, it is returned back. Otherwise {\ttfamily Type\+Error} is thrown.


\begin{DoxyCode}{0}
\DoxyCodeLine{const ensureError = require("{}type/error/ensure"{});}
\DoxyCodeLine{}
\DoxyCodeLine{const someError = new Error("{}Some error"{});}
\DoxyCodeLine{ensureError(someError); // someError}
\DoxyCodeLine{ensureError(\{ message: "{}Fake error"{} \}); // Thrown TypeError: [object Object] is not an error object }

\end{DoxyCode}
 