#how to find out from which line I get into "errdefer"?
1 messages · Page 1 of 1 (latest)
errdefer is mainly designed for cases where you need to free up resources in case of an error.
If you want different behavior for each error site then I think you should use catch blocks instead of errdefer:
errorFunction1() catch |err| {
... // Your code that handles errors from function 1
return err;
};
errorFunction2() catch |err| {
... // Your code that handles errors from function 2
return err;
};