<commit_before>// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "sky/engine/tonic/dart_error.h"

#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;
    return true;
  }
  return false;
}

}  // namespace blink<commit_msg>Switch to the other stack trace printer<commit_after>// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "sky/engine/tonic/dart_error.h"

#include "base/logging.h"

namespace blink {
namespace DartError {
const char kInvalidArgument[] = "Invalid argument.";
}  // namespace DartError

bool LogIfError(Dart_Handle handle) {
  if (Dart_IsError(handle)) {
    LOG(ERROR) << Dart_GetError(handle);
    return true;
  }
  return false;
}

}  // namespace blink
{'fraction_non_alphanumeric': 0.1051230871590153, 'fraction_numerical': 0.0053226879574184965, 'mean_word_length': 3.915032679738562, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2989280', 'n_tokens_mistral': 481, 'n_tokens_neox': 462, 'n_words': 139}