tractordev / wanix

Experimental, local-first, web-native, Unix-like development environment
https://wanix.sh
MIT License
225 stars 11 forks source link

Fix `indexedfs` error handling and complete `mv` command #95

Closed Parzival-3141 closed 8 months ago

Parzival-3141 commented 8 months ago

Closes #79

Turns out one of those pesky todos came back to haunt me, go figure. The panic was due to how we resolve filesystem errors to error codes for syscalls. indexedfs helper calls were returning generic syscall/js.Error errors which we couldn't properly resolve in jsutil.go:ToJSError(), causing a panic in the os package which expected to find an error code.

I fixed this by explicitly stating which Go error to return when erroring in the JS helper. I also finished the mv command and did some other cleanup.