Throws an error, ensuring it's an Error instance. If the input is not an Error, wraps it in one.
Error to throw
Optional
Additional context message
Always throws
throwError(new Error('Something went wrong')); Copy
throwError(new Error('Something went wrong'));
Throws an error, ensuring it's an Error instance. If the input is not an Error, wraps it in one.