Skip to content

Commit

Permalink
Improve Error Logging for Font Imports (oblador#1475)
Browse files Browse the repository at this point in the history
Improve error logging for failed font imports by including the missing fonts name in the error message. Current exception message is not detailed enough to help developers troubleshoot which exact font is failing without jumping from debugging JS --> Objective C code.
  • Loading branch information
JKeddo95 authored Jul 17, 2023
1 parent 6e48dbd commit cbf9e24
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion RNVectorIconsManager/RNVectorIconsManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ - (NSString *)createGlyphImagePathForFont:(NSString *)fontName
if (error.code == kCTFontManagerErrorAlreadyRegistered || error.code == kCTFontManagerErrorDuplicatedName) {
resolve(nil);
} else {
reject(@"font_load_failed", @"Font failed to load", error);
NSString *errorMessage = [NSString stringWithFormat:@"Font '%@' failed to load", fontFileName];
        reject(@"font_load_failed", errorMessage, error);
}
} else {
resolve(nil);
Expand Down

0 comments on commit cbf9e24

Please sign in to comment.