OpenZGY/C++ API and Internals (ALPHA)
Access seismic data stored in ZGY format.
exception.h
Go to the documentation of this file.
1 // Copyright 2017-2020, Schlumberger
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #pragma once
16 
17 #include "declspec.h"
18 #include <stdexcept>
19 
30 namespace OpenZGY { namespace Errors {
31 #if 0
32 }}
33 #endif
34 
40 #ifdef _MSC_VER
41 #pragma warning(push)
42 #pragma warning(disable: 4275) // std::runtine_error not dll-exported
43 #endif
44 
48 class OPENZGY_API ZgyError: public std::runtime_error
49 {
50 protected:
52  ZgyError(const std::string& arg);
53 };
54 
55 #ifdef _MSC_VER
56 #pragma warning(pop)
57 #endif
58 
66 class OPENZGY_API ZgyFormatError: public ZgyError
67 {
68 public:
70  ZgyFormatError(const std::string& arg);
71 };
72 
84 class OPENZGY_API ZgyCorruptedFile: public ZgyError
85 {
86 public:
88  ZgyCorruptedFile(const std::string& arg);
89 };
90 
98 class OPENZGY_API ZgyUserError: public ZgyError
99 {
100 public:
102  ZgyUserError(const std::string& arg);
103 };
104 
115 class OPENZGY_API ZgyInternalError: public ZgyError
116 {
117 public:
119  ZgyInternalError(const std::string& arg);
120 };
121 
128 class OPENZGY_API ZgyEndOfFile: public ZgyError
129 {
130 public:
132  ZgyEndOfFile(const std::string& arg);
133 };
134 
143 class OPENZGY_API ZgySegmentIsClosed: public ZgyError
144 {
145 public:
147  ZgySegmentIsClosed(const std::string& arg);
148 };
149 
158 class OPENZGY_API ZgyAborted: public ZgyError
159 {
160 public:
162  ZgyAborted(const std::string& arg);
163 };
164 
172 class OPENZGY_API ZgyMissingFeature: public ZgyError
173 {
174 public:
176  ZgyMissingFeature(const std::string& arg);
177 };
178 
186 class OPENZGY_API ZgyIoError: public ZgyError
187 {
188 public:
190  ZgyIoError(const std::string& filename, int system_errno);
191 };
192 
197 }} // namespace
OpenZGY::Errors::ZgyInternalError
Exception that might be caused by a bug in OpenZGY.
Definition: exception.h:115
OpenZGY::Errors::ZgyMissingFeature
Missing feature.
Definition: exception.h:172
OpenZGY::Errors::ZgyFormatError
Corrupted or unsupported ZGY file.
Definition: exception.h:66
OpenZGY::Errors::ZgyAborted
User aborted the computation.
Definition: exception.h:158
OpenZGY
The entire public API is in this namespace.
Definition: api.cpp:68
OpenZGY::Errors::ZgyEndOfFile
Trying to read past EOF.
Definition: exception.h:128
OpenZGY::Errors::ZgyUserError
Exception that might be caused by the calling application.
Definition: exception.h:98
OpenZGY::Errors::ZgyError
Base class for all exceptions thrown by OpenZGY.
Definition: exception.h:48
OpenZGY::Errors::ZgyIoError
Exception from the I/O layer.
Definition: exception.h:186
OpenZGY::Errors::ZgyCorruptedFile
The ZGY file became corrupted while writing to it.
Definition: exception.h:84
OpenZGY::Errors::ZgySegmentIsClosed
Exception used internally to request a retry.
Definition: exception.h:143