aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/bindings/helpers.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/bun.js/bindings/helpers.h')
-rw-r--r--src/bun.js/bindings/helpers.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/bun.js/bindings/helpers.h b/src/bun.js/bindings/helpers.h
index 00777c304..79aa3d472 100644
--- a/src/bun.js/bindings/helpers.h
+++ b/src/bun.js/bindings/helpers.h
@@ -391,6 +391,19 @@ static JSC::JSValue getRangeErrorInstance(const ZigString* str, JSC__JSGlobalObj
}; // namespace Zig
+JSC::JSValue createSystemError(JSC::JSGlobalObject* global, ASCIILiteral message, ASCIILiteral syscall, int err);
+JSC::JSValue createSystemError(JSC::JSGlobalObject* global, ASCIILiteral syscall, int err);
+
+static void throwSystemError(JSC::ThrowScope& scope, JSC::JSGlobalObject* globalObject, ASCIILiteral syscall, int err)
+{
+ scope.throwException(globalObject, createSystemError(globalObject, syscall, err));
+}
+
+static void throwSystemError(JSC::ThrowScope& scope, JSC::JSGlobalObject* globalObject, ASCIILiteral message, ASCIILiteral syscall, int err)
+{
+ scope.throwException(globalObject, createSystemError(globalObject, message, syscall, err));
+}
+
template<typename WebCoreType, typename OutType>
OutType* WebCoreCast(JSC__JSValue JSValue0)
{