Spicy
error.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/error.h>
7 
8 namespace hilti::operator_ { // NOLINT(modernize-concat-nested-namespaces)
9 
10 STANDARD_KEYWORD_CTOR(error, Ctor, "error", type::Error(), type::String(), "Creates an error with the given message.");
11 
12 BEGIN_METHOD(error, Description)
13  const auto& signature() const {
14  static auto _signature = Signature{.self = type::Error(),
15  .result = type::String(),
16  .id = "description",
17  .args = {},
18  .doc = "Retrieves the textual description associated with the error."};
19  return _signature;
20  }
21 END_METHOD
22 
23 } // namespace hilti::operator_
Definition: operator-registry.h:15