1 Commits

Author SHA1 Message Date
John Alanbrook
957b964d9d better disrupt message on fd 2026-02-25 20:38:34 -06:00

View File

@@ -117,10 +117,10 @@ JSC_CCALL(fd_read,
JSC_SCALL(fd_slurp, JSC_SCALL(fd_slurp,
struct stat st; struct stat st;
if (stat(str, &st) != 0) if (stat(str, &st) != 0)
return JS_RaiseDisrupt(js, "stat failed: %s", strerror(errno)); return JS_RaiseDisrupt(js, "stat failed for %s: %s", str, strerror(errno));
if (!S_ISREG(st.st_mode)) if (!S_ISREG(st.st_mode))
return JS_RaiseDisrupt(js, "path is not a regular file"); return JS_RaiseDisrupt(js, "path %s is not a regular file", str);
size_t size = st.st_size; size_t size = st.st_size;
if (size == 0) if (size == 0)