Open yochem opened 1 year ago
Oops, seems that wrapping the custom errors in IError()
solves the problem 🙊
Ah, good catch then. V should still give a nicer error message, but at least you already know how to avoid it. :-)
A better error message would indeed be nice ;)
Let's leave it open until that better error message comes along.
Describe the bug
I'm currently working on a
pathlib
library forv
: #16782. I wanted to implement a wrapper function aroundos.open
, and raise a custom error if it didn't work, like so:I started the
v
repl using a freshly builtv
from git (of my fork, with the only difference being that it has thepathlib
module invlib/
):Here's the C output: https://gist.github.com/yochem/60d58b76372191d143bdf6d4683a6b68.
Expected Behavior
Not crashing
Current Behavior
Crashing
Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
V version
V 0.3.2 f959fbb
Environment details (OS name and version, etc.)
OS: macos, macOS, 13.0.1, 22A400 Processor: 4 cpus, 64bit, little endian, Intel(R) Core(TM) i5-8210Y CPU @ 1.60GHz CC version: Apple clang version 14.0.0 (clang-1400.0.29.202)
getwd: /Users/yochem/Documents/nv vmodules: /Users/yochem/.vmodules vroot: /Users/yochem/Documents/nv vexe: /Users/yochem/Documents/nv/v vexe mtime: 2023-01-09 12:52:32 is vroot writable: true is vmodules writable: false V full version: V 0.3.2 2ec6e2b.f959fbb
Git version: git version 2.39.0 Git vroot status: weekly.2022.52-14-gf959fbbc (72 commit(s) behind V master) .git/config present: true thirdparty/tcc status: thirdparty-macos-amd64 46662e20