From cbf9e24817a0016d2fe423e5117df5e827e2eeb7 Mon Sep 17 00:00:00 2001 From: JKeddo95 Date: Mon, 17 Jul 2023 03:21:32 -0700 Subject: [PATCH] Improve Error Logging for Font Imports (#1475) 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. --- RNVectorIconsManager/RNVectorIconsManager.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RNVectorIconsManager/RNVectorIconsManager.m b/RNVectorIconsManager/RNVectorIconsManager.m index de7c5e830..02a5f4929 100644 --- a/RNVectorIconsManager/RNVectorIconsManager.m +++ b/RNVectorIconsManager/RNVectorIconsManager.m @@ -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);