blob: c045c4e447f2ed3f313e8a9d10d55a05731e49d7 [file] [log] [blame]
<!DOCTYPE html>
<!--
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.
-->
<link rel="import" href="/perf_insights/mre/failure.html">
<link rel="import" href="/tracing/base/utils.html">
<script>
'use strict';
tr.exportTo('pi.mre', function() {
function runAndConvertErrorsToFailures(results, job, functionHandle,
traceHandle, cb, opt_this) {
try {
cb.call(opt_this);
} catch (err) {
var err = tr.b.normalizeException(err);
results.addFailure(new pi.mre.Failure(
job, functionHandle, traceHandle, err.typeName,
err.message, err.stack));
}
}
return {
runAndConvertErrorsToFailures: runAndConvertErrorsToFailures
};
});