Project
Loading...
Searching...
No Matches
ErrorHandling.cxx
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#include <iostream>
12#include <sstream>
14
15using namespace o2::focal;
16
18{
19 std::string nameIndexType;
20 switch (source) {
22 nameIndexType = "channel";
23 break;
25 nameIndexType = "pad layer";
26 break;
28 nameIndexType = "pad half stave";
29 break;
31 nameIndexType = "pixel layer";
32 break;
34 nameIndexType = "trigger window";
35 default:
36 break;
37 }
38 mMessageBuffer = "Accessing invalid entry of type " + nameIndexType + ": " + std::to_string(index) + " ( max " + std::to_string(maxindex) + ")";
39}
40
41const char* IndexExceptionEvent::what() const noexcept
42{
43 return mMessageBuffer.data();
44}
45
46std::ostream& o2::focal::operator<<(std::ostream& stream, const o2::focal::IndexExceptionEvent& error)
47{
48 stream << error.what();
49 return stream;
50}
const char * what() const noexcept final
IndexExceptionEvent(unsigned int index, unsigned int maxindex, IndexType_t source)
GLuint index
Definition glcorearb.h:781
GLsizei GLsizei GLchar * source
Definition glcorearb.h:798
GLuint GLuint stream
Definition glcorearb.h:1806
std::ostream & operator<<(std::ostream &in, const IndexExceptionEvent &error)
std::string to_string(gsl::span< T, Size > span)
Definition common.h:52