Spicy
exception.h
1 // Copyright (c) 2020-2021 by the Zeek Project. See LICENSE for details.
2 
3 #pragma once
4 
5 #include <hilti/ast/operators/common.h>
6 #include <hilti/ast/types/exception.h>
7 
8 namespace hilti::operator_ {
9 
10 BEGIN_CTOR(exception, Ctor)
11  auto ctorType() const { return type::Exception(type::Wildcard()); }
12 
13  const auto& signature() const {
14  static auto _signature = Signature{.args = {{"msg", type::String()}}, .doc = R"(
15 Instantiates an instance of the exception type carrying the error message *msg*.
16 )"};
17  return _signature;
18  }
19 END_CTOR
20 
21 BEGIN_METHOD(exception, Description)
22  const auto& signature() const {
23  static auto _signature = Signature{.self = type::Exception(type::Wildcard()),
24  .result = type::String(),
25  .id = "description",
26  .args = {},
27  .doc = R"(
28 Returns the textual message associated with an exception object.
29 )"};
30  return _signature;
31  }
32 END_METHOD
33 } // namespace hilti::operator_
Definition: operator-registry.h:15