Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Unified Diff: runtime/bin/main.cc

Issue 1403683007: Fix for issue 23908 - error message reports the exact error when a native extension fails to load. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: code-review Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« runtime/bin/extensions_android.cc ('K') | « runtime/bin/extensions_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/main.cc
diff --git a/runtime/bin/main.cc b/runtime/bin/main.cc
index 1429ff4e65315ec2d5760de07f3f8c92ad1eebbc..c23281f67fb05857a3776cf0116ef41175987ff8 100644
--- a/runtime/bin/main.cc
+++ b/runtime/bin/main.cc
@@ -1092,15 +1092,21 @@ static void ReadSnapshotFile(const char* filename,
static void* LoadLibrarySymbol(const char* libname, const char* symname) {
- void* library = Extensions::LoadExtensionLibrary(libname);
- if (library == NULL) {
- Log::PrintErr("Error: Failed to load library '%s'\n", libname);
- exit(kErrorExitCode);
+ void* library = NULL;
+ Dart_Handle result = Extensions::LoadExtensionLibrary(libname, &library);
+ if (Dart_IsError(result)) {
+ ErrorExit(kErrorExitCode,
+ "Error: Failed to load library '%s' - '%s'\n",
+ libname,
+ Dart_GetError(result));
}
- void* symbol = Extensions::ResolveSymbol(library, symname);
- if (symbol == NULL) {
- Log::PrintErr("Error: Failed to load symbol '%s'\n", symname);
- exit(kErrorExitCode);
+ void* symbol = NULL;
+ result = Extensions::ResolveSymbol(library, symname, &symbol);
+ if (Dart_IsError(result)) {
+ ErrorExit(kErrorExitCode,
+ "Error: Failed to load symbol '%s' - '%s'\n",
+ symname,
+ Dart_GetError(result));
}
return symbol;
}
« runtime/bin/extensions_android.cc ('K') | « runtime/bin/extensions_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698