#prolly not good code help pls
1 messages · Page 1 of 1 (latest)
We'd need to see the rest of the code. A quick description of the context of what you're doing is usually helpful.
just bubble up the error, create another function that swallows the error and returns null
yeah probably best to use try instead of catch and have parent function handle the error.
If skipRemaining was made non-falliable, then you could keep in this function's context by having errdefer skipRemaining() at beginning
it's actually a mix of orelse and catch, i ended up putting everything relevant in a block that is ?void
and if the block is null it does the cleanup
{
try skipRemaining();
return null;
}
returning an error or null seems odd
as try is catch |err| return err
!?void is fine