ATLAS Offline Software
CaloID_Exception.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include "CxxUtils/StrFormat.h"
7 
9 
10 
12 m_message("No error message") , m_code( 999 )
13 { }
14 
15 CaloID_Exception::CaloID_Exception(const std::string& lMessage , int lCode) :
16 m_message ( lMessage ) , m_code ( lCode )
17 { }
18 
19 void CaloID_Exception::message(const std::string& lMessage)
20 { m_message = lMessage ;}
21 
22 std::string CaloID_Exception::message() const
23 { return m_message;}
24 
25 void CaloID_Exception::code(int lCode)
26 { m_code = lCode ;}
27 
29 { return m_code;}
30 
31 CaloID_Exception::operator std::string () const
32 
33 {
34  return
35  strformat ("CaloID_Exception - Error code: %d \n ", this->code()) +
36  this->message();
37 }
38 
ReweightUtils.message
message
Definition: ReweightUtils.py:15
CaloID_Exception::m_message
std::string m_message
error message
Definition: CaloID_Exception.h:69
StrFormat.h
Provide helper functions to create formatted strings.
CaloID_Exception::code
int code() const
return error code
Definition: CaloID_Exception.cxx:28
CaloID_Exception::message
std::string message() const
return error message
Definition: CaloID_Exception.cxx:22
CaloID_Exception::CaloID_Exception
CaloID_Exception()
default constructor
Definition: CaloID_Exception.cxx:11
pmontree.code
code
Definition: pmontree.py:443
CxxUtils::strformat
std::string strformat(const char *fmt,...)
return a std::string according to a format fmt and varargs
Definition: StrFormat.cxx:49
CaloID_Exception.h
CaloID_Exception::m_code
int m_code
error code
Definition: CaloID_Exception.h:74