LibHac icon indicating copy to clipboard operation
LibHac copied to clipboard

some exceptions are not rethrown

Open mrissaoussama opened this issue 1 year ago • 2 comments

some exceptions in the library are caught are not rethrown, instead they write to console. example in SwitchFs: image this causes some errors to be missed because the exceptions are swallowed. I suggest to remove the try catch statements or add throw; at the end of the catch statement

mrissaoussama avatar Dec 23 '23 20:12 mrissaoussama

Rethrowing the exception in this example would make the entire operation fail if you didn't have a key for a single nca. What alternative method did you have in mind for reporting these errors?

Thealexbarney avatar May 14 '24 00:05 Thealexbarney

maybe have a constructor or a SetLogger() that takes an ILogger, the catch would log the error to the logger if it's not null

mrissaoussama avatar May 16 '24 17:05 mrissaoussama