1 // Copyright 2013 The Flutter Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef FLUTTER_SHELL_PLATFORM_FUCHSIA_RUNTIME_DART_UTILS_HANDLE_EXCEPTION_H_ 6 #define FLUTTER_SHELL_PLATFORM_FUCHSIA_RUNTIME_DART_UTILS_HANDLE_EXCEPTION_H_ 7 8 #include <lib/sys/cpp/service_directory.h> 9 #include <third_party/dart/runtime/include/dart_api.h> 10 11 #include <memory> 12 #include <string> 13 14 namespace dart_utils { 15 16 // If |result| is a Dart Exception, passes the exception message and stack trace 17 // to the crash analyzer service for further handling. 18 void HandleIfException(std::shared_ptr<::sys::ServiceDirectory> services, 19 const std::string& component_url, 20 Dart_Handle result); 21 22 // Passes the exception message and stack trace to the crash analyzer service 23 // for further handling. 24 void HandleException(std::shared_ptr<::sys::ServiceDirectory> services, 25 const std::string& component_url, 26 const std::string& error, 27 const std::string& stack_trace); 28 29 } // namespace dart_utils 30 31 #endif // FLUTTER_SHELL_PLATFORM_FUCHSIA_RUNTIME_DART_UTILS_HANDLE_EXCEPTION_H_ 32