Index: runtime/vm/object.cc |
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc |
index 69cd625ca603190014f9cf4a1be04b87a4b4d0bd..b012e5a80fe6bba680491c37853f7619fb627382 100644 |
--- a/runtime/vm/object.cc |
+++ b/runtime/vm/object.cc |
@@ -15178,6 +15178,13 @@ RawApiError* ApiError::New() { |
RawApiError* ApiError::New(const String& message, Heap::Space space) { |
+#ifndef PRODUCT |
+ if (FLAG_print_stacktrace_at_api_error) { |
+ OS::PrintErr("ApiError: %s\n", message.ToCString()); |
+ Profiler::DumpStackTrace(false /* for_crash */); |
+ } |
+#endif // !PRODUCT |
+ |
ASSERT(Object::api_error_class() != Class::null()); |
ApiError& result = ApiError::Handle(); |
{ |