Project
Loading...
Searching...
No Matches
Errors.h
Go to the documentation of this file.
1// Copyright 2019-2026 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#ifndef O2_FRAMEWORK_AODNATIVE_ERRORS_H_
13#define O2_FRAMEWORK_AODNATIVE_ERRORS_H_
14
15#include <cstdint>
16#include <stdexcept>
17#include <string>
18
19namespace o2::aod::native
20{
21
24struct FormatError : std::runtime_error {
25 using std::runtime_error::runtime_error;
26};
27
30 UnsupportedVersion(std::string className_, int version_, std::string file_)
31 : FormatError("unsupported version " + std::to_string(version_) + " of class " + className_ + " in " + file_),
32 className(std::move(className_)),
33 version(version_),
34 file(std::move(file_))
35 {
36 }
37 std::string className;
39 std::string file;
40};
41
45 explicit UnsupportedLayout(std::string what_)
46 : FormatError("unsupported layout: " + what_),
47 detail(std::move(what_))
48 {
49 }
50 std::string detail;
51};
52
56 CorruptData(std::string file_, uint64_t offset_, std::string what_)
57 : FormatError("corrupt data in " + file_ + " at offset " + std::to_string(offset_) + ": " + what_),
58 file(std::move(file_)),
59 offset(offset_),
60 detail(std::move(what_))
61 {
62 }
63 std::string file;
64 uint64_t offset;
65 std::string detail;
66};
67
70 IoError(std::string url_, std::string status_)
71 : FormatError("I/O error on " + url_ + ": " + status_),
72 url(std::move(url_)),
73 status(std::move(status_))
74 {
75 }
76 std::string url;
77 std::string status;
78};
79
80} // namespace o2::aod::native
81
82#endif // O2_FRAMEWORK_AODNATIVE_ERRORS_H_
GLintptr offset
Definition glcorearb.h:660
CorruptData(std::string file_, uint64_t offset_, std::string what_)
Definition Errors.h:56
Failure of the underlying transport.
Definition Errors.h:69
IoError(std::string url_, std::string status_)
Definition Errors.h:70
std::string status
Definition Errors.h:77
UnsupportedLayout(std::string what_)
Definition Errors.h:45
A class version we have no hardcoded layout for.
Definition Errors.h:29
UnsupportedVersion(std::string className_, int version_, std::string file_)
Definition Errors.h:30