Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
2 days ago bd039d1e92813358c5c5a1e346b49074baf513f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
 
#pragma once
 
#include "onnxruntime_pybind.h"  // must use this for the include of <pybind11/pybind11.h>
#include <stdexcept>
#include "core/common/status.h"
 
namespace onnxruntime {
namespace python {
 
// onnxruntime::python exceptions map 1:1 to onnxruntime:common::StatusCode enum.
struct Fail : std::runtime_error {
  explicit Fail(const std::string& what) : std::runtime_error(what) {}
};
struct InvalidArgument : std::runtime_error {
  explicit InvalidArgument(const std::string& what) : std::runtime_error(what) {}
};
struct NoSuchFile : std::runtime_error {
  explicit NoSuchFile(const std::string& what) : std::runtime_error(what) {}
};
struct NoModel : std::runtime_error {
  explicit NoModel(const std::string& what) : std::runtime_error(what) {}
};
struct EngineError : std::runtime_error {
  explicit EngineError(const std::string& what) : std::runtime_error(what) {}
};
struct RuntimeException : std::runtime_error {
  explicit RuntimeException(const std::string& what) : std::runtime_error(what) {}
};
struct InvalidProtobuf : std::runtime_error {
  explicit InvalidProtobuf(const std::string& what) : std::runtime_error(what) {}
};
struct ModelLoaded : std::runtime_error {
  explicit ModelLoaded(const std::string& what) : std::runtime_error(what) {}
};
struct NotImplemented : std::runtime_error {
  explicit NotImplemented(const std::string& what) : std::runtime_error(what) {}
};
struct InvalidGraph : std::runtime_error {
  explicit InvalidGraph(const std::string& what) : std::runtime_error(what) {}
};
struct EPFail : std::runtime_error {
  explicit EPFail(const std::string& what) : std::runtime_error(what) {}
};
struct ModelLoadCanceled : std::runtime_error {
  explicit ModelLoadCanceled(const std::string& what) : std::runtime_error(what) {}
};
struct ModelRequiresCompilation : std::runtime_error {
  explicit ModelRequiresCompilation(const std::string& what) : std::runtime_error(what) {}
};
struct NotFound : std::runtime_error {
  explicit NotFound(const std::string& what) : std::runtime_error(what) {}
};
 
struct DeviceReset : std::runtime_error {
  explicit DeviceReset(const std::string& what) : std::runtime_error(what) {}
};
 
void RegisterExceptions(pybind11::module& m);
 
void OrtPybindThrowIfError(onnxruntime::common::Status status);
 
}  // namespace python
}  // namespace onnxruntime