1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:58:11 +00:00

AK+LibMain: Improve formatter for AK::Error in userspace

Print the full associated string metadata by default (if available.)
This commit is contained in:
Andreas Kling 2021-12-20 11:55:32 +01:00
parent 8877dd0eea
commit 452a5531be
3 changed files with 12 additions and 6 deletions

View file

@ -24,12 +24,7 @@ int main(int argc, char** argv)
});
if (result.is_error()) {
auto error = result.release_error();
if (error.is_syscall())
warnln("Runtime error: {}: {} (errno={})", error.string_literal(), strerror(error.code()), error.code());
else if (error.is_errno())
warnln("Runtime error: {} (errno={})", strerror(error.code()), error.code());
else
warnln("Runtime error: {}", error.string_literal());
warnln("Runtime error: {}", error);
return 1;
}
return result.value();