Project
Loading...
Searching...
No Matches
RawDecodingError.h
Go to the documentation of this file.
1// Copyright 2019-2020 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#ifndef ALICEO2_PHOS_RAWDECODINGERROR_H
12#define ALICEO2_PHOS_RAWDECODINGERROR_H
13
14#include <exception>
15
16namespace o2
17{
18
19namespace phos
20{
21
30class RawDecodingError : public std::exception
31{
32 public:
42
48 RawDecodingError(ErrorType_t errtype) : mErrorType(errtype)
49 {
50 }
51
53 ~RawDecodingError() noexcept override = default;
54
57 const char* what() const noexcept override
58 {
59 switch (mErrorType) {
61 return "Page with requested index not found";
63 return "RDH of page cannot be decoded";
65 return "Payload of page cannot be decoded";
67 return "Access to header not belonging to requested superpage";
69 return "Access to payload not belonging to requested superpage";
70 };
71 return "Undefined error";
72 }
73
76 ErrorType_t getErrorType() const { return mErrorType; }
77
78 private:
79 ErrorType_t mErrorType;
80};
81
82} // namespace phos
83
84} // namespace o2
85
86#endif
Error handling of the raw reader.
ErrorType_t getErrorType() const
Get the type identifier of the error handled with this exception.
const char * what() const noexcept override
Providing error message of the exception.
ErrorType_t
Codes for different error types.
@ HEADER_DECODING
Header cannot be decoded (format incorrect)
@ PAGE_NOTFOUND
Page was not found (page index outside range)
@ HEADER_INVALID
Header in memory not belonging to requested superpage.
@ PAYLOAD_DECODING
Payload cannot be decoded (format incorrect)
@ PAYLOAD_INVALID
Payload in memory not belonging to requested superpage.
~RawDecodingError() noexcept override=default
destructor
RawDecodingError(ErrorType_t errtype)
Constructor.
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...