Skip to content

Commit

Permalink
Adds wasi func name to missing exception (#321)
Browse files Browse the repository at this point in the history
  • Loading branch information
bhelx authored May 9, 2024
1 parent 98ae0ad commit 2bc9844
Showing 1 changed file with 48 additions and 25 deletions.
73 changes: 48 additions & 25 deletions wasi/src/main/java/com/dylibso/chicory/wasi/WasiPreview1.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ public HostFunction adapterCloseBadfd() {
return new HostFunction(
(Instance instance, Value... args) -> {
logger.info("adapter_close_badfd: " + Arrays.toString(args));
throw new WASMRuntimeException("We don't yet support this WASI call");
throw new WASMRuntimeException(
"We don't yet support this WASI call: adapter_close_badfd");
// return new Value[] { Value.i32(0) };
},
"wasi_snapshot_preview1",
Expand All @@ -112,7 +113,8 @@ public HostFunction adapterOpenBadfd() {
return new HostFunction(
(Instance instance, Value... args) -> {
logger.info("adapter_open_badfd: " + Arrays.toString(args));
throw new WASMRuntimeException("We don't yet support this WASI call");
throw new WASMRuntimeException(
"We don't yet support this WASI call: adapter_open_badfd");
// return new Value[] { Value.i32(0) };
},
"wasi_snapshot_preview1",
Expand Down Expand Up @@ -168,7 +170,8 @@ public HostFunction clockResGet() {
return new HostFunction(
(Instance instance, Value... args) -> {
logger.info("clock_res_get: " + Arrays.toString(args));
throw new WASMRuntimeException("We don't yet support this WASI call");
throw new WASMRuntimeException(
"We don't yet support this WASI call: clock_res_get");
// return new Value[] { Value.i32(0) };
},
"wasi_snapshot_preview1",
Expand Down Expand Up @@ -267,7 +270,8 @@ public HostFunction fdAdvise() {
return new HostFunction(
(Instance instance, Value... args) -> {
logger.info("fd_advise: " + Arrays.toString(args));
throw new WASMRuntimeException("We don't yet support this WASI call");
throw new WASMRuntimeException(
"We don't yet support this WASI call: fd_advise");
// return new Value[] { Value.i32(0) };
},
"wasi_snapshot_preview1",
Expand All @@ -280,7 +284,8 @@ public HostFunction fdAllocate() {
return new HostFunction(
(Instance instance, Value... args) -> {
logger.info("fd_allocate: " + Arrays.toString(args));
throw new WASMRuntimeException("We don't yet support this WASI call");
throw new WASMRuntimeException(
"We don't yet support this WASI call: fd_allocate");
// return new Value[] { Value.i32(0) };
},
"wasi_snapshot_preview1",
Expand Down Expand Up @@ -321,7 +326,8 @@ public HostFunction fdDatasync() {
return new HostFunction(
(Instance instance, Value... args) -> {
logger.info("fd_datasync: " + Arrays.toString(args));
throw new WASMRuntimeException("We don't yet support this WASI call");
throw new WASMRuntimeException(
"We don't yet support this WASI call: fd_datasync");
// return new Value[] { Value.i32(0) };
},
"wasi_snapshot_preview1",
Expand Down Expand Up @@ -418,7 +424,8 @@ public HostFunction fdFdstatSetRights() {
return new HostFunction(
(Instance instance, Value... args) -> {
logger.info("fd_fdstat_set_rights: " + Arrays.toString(args));
throw new WASMRuntimeException("We don't yet support this WASI call");
throw new WASMRuntimeException(
"We don't yet support this WASI call: fd_fdstat_set_rightsn");
// return new Value[] { Value.i32(0) };
},
"wasi_snapshot_preview1",
Expand Down Expand Up @@ -485,7 +492,8 @@ public HostFunction fdFilestatSetSize() {
return new HostFunction(
(Instance instance, Value... args) -> {
logger.info("fd_filestat_set_size: " + Arrays.toString(args));
throw new WASMRuntimeException("We don't yet support this WASI call");
throw new WASMRuntimeException(
"We don't yet support this WASI call: fd_filestat_set_size");
// return new Value[] { Value.i32(0) };
},
"wasi_snapshot_preview1",
Expand All @@ -498,7 +506,8 @@ public HostFunction fdFilestatSetTimes() {
return new HostFunction(
(Instance instance, Value... args) -> {
logger.info("fd_filestat_set_times: " + Arrays.toString(args));
throw new WASMRuntimeException("We don't yet support this WASI call");
throw new WASMRuntimeException(
"We don't yet support this WASI call: fd_filestat_set_times");
// return new Value[] { Value.i32(0) };
},
"wasi_snapshot_preview1",
Expand All @@ -511,7 +520,7 @@ public HostFunction fdPread() {
return new HostFunction(
(Instance instance, Value... args) -> {
logger.info("fd_pread: " + Arrays.toString(args));
throw new WASMRuntimeException("We don't yet support this WASI call");
throw new WASMRuntimeException("We don't yet support this WASI call: fd_pread");
// return new Value[] { Value.i32(0) };
},
"wasi_snapshot_preview1",
Expand Down Expand Up @@ -583,7 +592,8 @@ public HostFunction fdPwrite() {
return new HostFunction(
(Instance instance, Value... args) -> {
logger.info("fd_pwrite: " + Arrays.toString(args));
throw new WASMRuntimeException("We don't yet support this WASI call");
throw new WASMRuntimeException(
"We don't yet support this WASI call: fd_pwrite");
// return new Value[] { Value.i32(0) };
},
"wasi_snapshot_preview1",
Expand Down Expand Up @@ -734,7 +744,8 @@ public HostFunction fdRenumber() {
return new HostFunction(
(Instance instance, Value... args) -> {
logger.info("fd_renumber: " + Arrays.toString(args));
throw new WASMRuntimeException("We don't yet support this WASI call");
throw new WASMRuntimeException(
"We don't yet support this WASI call: fd_renumber");
},
"wasi_snapshot_preview1",
"fd_renumber",
Expand Down Expand Up @@ -804,7 +815,7 @@ public HostFunction fdSync() {
return new HostFunction(
(Instance instance, Value... args) -> {
logger.info("fd_sync: " + Arrays.toString(args));
throw new WASMRuntimeException("We don't yet support this WASI call");
throw new WASMRuntimeException("We don't yet support this WASI call: fd_sync");
// return new Value[] {Value.i32(0)};
},
"wasi_snapshot_preview1",
Expand Down Expand Up @@ -999,7 +1010,8 @@ public HostFunction pathFilestatSetTimes() {
return new HostFunction(
(Instance instance, Value... args) -> {
logger.info("path_filestat_set_times: " + Arrays.toString(args));
throw new WASMRuntimeException("We don't yet support this WASI call");
throw new WASMRuntimeException(
"We don't yet support this WASI call: path_filestat_set_times");
},
"wasi_snapshot_preview1",
"path_filestat_set_times",
Expand All @@ -1011,7 +1023,8 @@ public HostFunction pathLink() {
return new HostFunction(
(Instance instance, Value... args) -> {
logger.info("path_link: " + Arrays.toString(args));
throw new WASMRuntimeException("We don't yet support this WASI call");
throw new WASMRuntimeException(
"We don't yet support this WASI call: path_link");
},
"wasi_snapshot_preview1",
"path_link",
Expand Down Expand Up @@ -1265,7 +1278,8 @@ public HostFunction pathSymlink() {
return new HostFunction(
(Instance instance, Value... args) -> {
logger.info("path_symlink: " + Arrays.toString(args));
throw new WASMRuntimeException("We don't yet support this WASI call");
throw new WASMRuntimeException(
"We don't yet support this WASI call: path_symlink");
},
"wasi_snapshot_preview1",
"path_symlink",
Expand Down Expand Up @@ -1325,7 +1339,8 @@ public HostFunction pollOneoff() {
return new HostFunction(
(Instance instance, Value... args) -> {
logger.info("poll_oneoff: " + Arrays.toString(args));
throw new WASMRuntimeException("We don't yet support this WASI call");
throw new WASMRuntimeException(
"We don't yet support this WASI call: poll_oneoff");
},
"wasi_snapshot_preview1",
"poll_oneoff",
Expand All @@ -1350,7 +1365,8 @@ public HostFunction procRaise() {
return new HostFunction(
(Instance instance, Value... args) -> {
logger.info("proc_raise: " + Arrays.toString(args));
throw new WASMRuntimeException("We don't yet support this WASI call");
throw new WASMRuntimeException(
"We don't yet support this WASI call: proc_raise");
},
"wasi_snapshot_preview1",
"proc_raise",
Expand Down Expand Up @@ -1387,7 +1403,8 @@ public HostFunction resetAdapterState() {
return new HostFunction(
(Instance instance, Value... args) -> {
logger.info("reset_adapter_state: " + Arrays.toString(args));
throw new WASMRuntimeException("We don't yet support this WASI call");
throw new WASMRuntimeException(
"We don't yet support this WASI call: reset_adapter_state");
},
"wasi_snapshot_preview1",
"reset_adapter_state",
Expand All @@ -1412,7 +1429,8 @@ public HostFunction setAllocationState() {
return new HostFunction(
(Instance instance, Value... args) -> {
logger.info("set_allocation_state: " + Arrays.toString(args));
throw new WASMRuntimeException("We don't yet support this WASI call");
throw new WASMRuntimeException(
"We don't yet support this WASI call: set_allocation_state");
},
"wasi_snapshot_preview1",
"set_allocation_state",
Expand All @@ -1424,7 +1442,8 @@ public HostFunction setStatePtr() {
return new HostFunction(
(Instance instance, Value... args) -> {
logger.info("set_state_ptr: " + Arrays.toString(args));
throw new WASMRuntimeException("We don't yet support this WASI call");
throw new WASMRuntimeException(
"We don't yet support this WASI call: set_state_ptr");
},
"wasi_snapshot_preview1",
"set_state_ptr",
Expand All @@ -1436,7 +1455,8 @@ public HostFunction sockAccept() {
return new HostFunction(
(Instance instance, Value... args) -> {
logger.info("sock_accept: " + Arrays.toString(args));
throw new WASMRuntimeException("We don't yet support this WASI call");
throw new WASMRuntimeException(
"We don't yet support this WASI call: sock_accept");
},
"wasi_snapshot_preview1",
"sock_accept",
Expand All @@ -1448,7 +1468,8 @@ public HostFunction sockRecv() {
return new HostFunction(
(Instance instance, Value... args) -> {
logger.info("sock_recv: " + Arrays.toString(args));
throw new WASMRuntimeException("We don't yet support this WASI call");
throw new WASMRuntimeException(
"We don't yet support this WASI call: sock_recv");
},
"wasi_snapshot_preview1",
"sock_recv",
Expand All @@ -1460,7 +1481,8 @@ public HostFunction sockSend() {
return new HostFunction(
(Instance instance, Value... args) -> {
logger.info("sock_send: " + Arrays.toString(args));
throw new WASMRuntimeException("We don't yet support this WASI call");
throw new WASMRuntimeException(
"We don't yet support this WASI call: sock_send");
},
"wasi_snapshot_preview1",
"sock_send",
Expand All @@ -1472,7 +1494,8 @@ public HostFunction sockShutdown() {
return new HostFunction(
(Instance instance, Value... args) -> {
logger.info("sock_shutdown: " + Arrays.toString(args));
throw new WASMRuntimeException("We don't yet support this WASI call");
throw new WASMRuntimeException(
"We don't yet support this WASI call: sock_shutdown");
},
"wasi_snapshot_preview1",
"sock_shutdown",
Expand Down

0 comments on commit 2bc9844

Please sign in to comment.