3 ms·
Nice language! I am wondering how error handling / exceptions works in bolt? Quickly scanned the programming guide - but wasn't able to find it. Did i miss a s
by je42 1y ago
Nice language! I am wondering how error handling / exceptions works in bolt?
Quickly scanned the programming guide - but wasn't able to find it. Did i miss a section?
- progx 1y agoAs far as i can see it is simple, everything can return an Error, so you have to check the return value if it is an error. https://github.com/Beariish/bolt/blob/main/examples/error_handling.bolt https://github.com/Beariish/bolt/blob/main/examples/error_ha...
- mdaniel 1y agoThat's definitely not universally true, with even the core library getting into the "null indicates error" game https://github.com/Beariish/bolt/blob/0.1.0/doc/Bolt%20Standard%20Library/core.md?plain=1#L31 https://github.com/Beariish/bolt/blob/0.1.0/doc/Bolt%20Stand... or this fun middle ground where it could be Error or null https://github.com/Beariish/bolt/blob/0.1.0/doc/Bolt%20Standard%20Library/io.md?plain=1#L19 https://github.com/Beariish/bolt/blob/0.1.0/doc/Bolt%20Stand... But I think OP was asking about whatever the hell this means by "native error callback" https://github.com/Beariish/bolt/blob/0.1.0/doc/Bolt%20Standard%20Library/core.md?plain=1#L25 https://github.com/Beariish/bolt/blob/0.1.0/doc/Bolt%20Stand...
- je42 1y agoI think I was looking for both error / exception handling within the language and across the C api.