mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 23:59:49 +00:00
LibMedia: Add formatter for decoder errors
This is useful for print debugging.
This commit is contained in:
parent
c270241b09
commit
411cafa2a9
Notes:
github-actions[bot]
2025-03-14 07:48:57 +00:00
Author: https://github.com/tcl3
Commit: 411cafa2a9
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3931
Reviewed-by: https://github.com/gmta ✅
1 changed files with 12 additions and 0 deletions
|
@ -92,3 +92,15 @@ private:
|
|||
#define DECODER_TRY_ALLOC(expression) DECODER_TRY(DecoderErrorCategory::Memory, expression)
|
||||
|
||||
}
|
||||
|
||||
namespace AK {
|
||||
|
||||
template<>
|
||||
struct Formatter<Media::DecoderError> : Formatter<FormatString> {
|
||||
ErrorOr<void> format(FormatBuilder& builder, Media::DecoderError const& decoder_error)
|
||||
{
|
||||
return Formatter<FormatString>::format(builder, "[DecoderError]: {}"sv, decoder_error.description());
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue