mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Switch to the other stack trace printer
This commit is contained in:
parent
c0bf822d34
commit
aaacd90b8e
@ -7,26 +7,13 @@
|
||||
#include "base/logging.h"
|
||||
|
||||
namespace blink {
|
||||
|
||||
namespace DartError {
|
||||
|
||||
const char kInvalidArgument[] = "Invalid argument.";
|
||||
|
||||
} // namespace DartError
|
||||
|
||||
bool LogIfError(Dart_Handle handle) {
|
||||
if (Dart_IsError(handle)) {
|
||||
// Only unhandled exceptions have stacktraces.
|
||||
if (!Dart_ErrorHasException(handle)) {
|
||||
LOG(ERROR) << Dart_GetError(handle);
|
||||
return true;
|
||||
}
|
||||
|
||||
Dart_Handle stacktrace = Dart_ErrorGetStacktrace(handle);
|
||||
const char* stacktrace_cstr = "";
|
||||
Dart_StringToCString(Dart_ToString(stacktrace), &stacktrace_cstr);
|
||||
LOG(ERROR) << "Unhandled exception:";
|
||||
LOG(ERROR) << stacktrace_cstr;
|
||||
LOG(ERROR) << Dart_GetError(handle);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user