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