Consider `&& ( objectToString(e) === '[object Error]' || e instanceof Error )` to continue working with errors coming from another JavaScript contexts.