blob: 390fb2247936b2470091b3f8f95fdd9a803c969e [file] [log] [blame]
[email protected]855ab432013-11-18 17:09:361// Copyright 2013 The Chromium 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
[email protected]60531d52013-11-27 02:10:155#ifndef GIN_TRY_CATCH_H_
6#define GIN_TRY_CATCH_H_
[email protected]855ab432013-11-18 17:09:367
8#include <string>
9
10#include "base/basictypes.h"
11#include "v8/include/v8.h"
12
13namespace gin {
14
[email protected]60531d52013-11-27 02:10:1515// TryCatch is a convenient wrapper around v8::TryCatch.
[email protected]855ab432013-11-18 17:09:3616class TryCatch {
17 public:
18 TryCatch();
19 ~TryCatch();
20
21 bool HasCaught();
[email protected]2f703422013-11-25 21:26:1522 std::string GetStackTrace();
[email protected]855ab432013-11-18 17:09:3623
24 private:
25 v8::TryCatch try_catch_;
26
27 DISALLOW_COPY_AND_ASSIGN(TryCatch);
28};
29
30} // namespace gin
31
[email protected]60531d52013-11-27 02:10:1532#endif // GIN_TRY_CATCH_H_