Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:19:19

0001 // -*- C++ -*-
0002 //
0003 // This file is part of LHAPDF
0004 // Copyright (C) 2012-2024 The LHAPDF collaboration (see AUTHORS for details)
0005 //
0006 #pragma once
0007 #ifndef LHAPDF_Exceptions_H
0008 #define LHAPDF_Exceptions_H
0009 
0010 #include <exception>
0011 #include <stdexcept>
0012 
0013 namespace LHAPDF {
0014 
0015 
0016   /// @defgroup exceptions Exception classes for error handling
0017   ///@{
0018 
0019   /// @brief Generic unspecialised LHAPDF runtime error.
0020   ///
0021   /// NB. We don't use "Error" because that has a physics meaning!
0022   class Exception : public std::runtime_error {
0023   public:
0024     /// Constructor with error description string
0025     Exception(const std::string& what) : std::runtime_error(what) {}
0026   };
0027 
0028 
0029   /// Error for general PDF grid problems.
0030   class GridError : public Exception {
0031   public:
0032     /// Constructor with error description string
0033     GridError(const std::string& what) : Exception(what) {}
0034   };
0035 
0036 
0037   /// Error to be thrown when out of the valid range of a PDF.
0038   class RangeError : public Exception {
0039   public:
0040     /// Constructor with error description string
0041     RangeError(const std::string& what) : Exception(what) {}
0042   };
0043 
0044 
0045   /// Error for places where it should not have been possible to get to!
0046   class LogicError : public Exception {
0047   public:
0048     /// Constructor with error description string
0049     LogicError(const std::string& what) : Exception(what) {}
0050   };
0051 
0052 
0053   /// @brief Error for unfound or broken metadata entries.
0054   class MetadataError : public Exception {
0055   public:
0056     /// Constructor with error description string
0057     MetadataError(const std::string& what) : Exception(what) {}
0058   };
0059 
0060 
0061   /// @brief Error for file reading errors.
0062   class ReadError : public Exception {
0063   public:
0064     /// Constructor with error description string
0065     ReadError(const std::string& what) : Exception(what) {}
0066   };
0067 
0068 
0069   /// @brief Error for requests for unsupported/invalid flavour PIDs.
0070   class FlavorError : public Exception {
0071   public:
0072     /// Constructor with error description string
0073     FlavorError(const std::string& what) : Exception(what) {}
0074   };
0075 
0076 
0077   /// @brief Error to be raised by object factories given invalid requests.
0078   class FactoryError : public Exception {
0079   public:
0080     /// Constructor with error description string
0081     FactoryError(const std::string& what) : Exception(what) {}
0082   };
0083 
0084 
0085   /// @brief Error to be raised when a LHAPDF ID indexing fails
0086   class IndexError : public Exception {
0087   public:
0088     /// Constructor with error description string
0089     IndexError(const std::string& what) : Exception(what) {}
0090   };
0091 
0092 
0093   /// Error for general AlphaS computation problems.
0094   class AlphaSError : public Exception {
0095   public:
0096     /// Constructor with error description string
0097     AlphaSError(const std::string& what) : Exception(what) {}
0098   };
0099 
0100 
0101   /// @brief Error to be raised when a newer LHAPDF version is needed
0102   class VersionError : public Exception {
0103   public:
0104     /// Constructor with error description string
0105     VersionError(const std::string& what) : Exception(what) {}
0106   };
0107 
0108 
0109   /// Problem exists between keyboard and chair
0110   class UserError : public Exception {
0111   public:
0112     /// Constructor with error description string
0113     UserError(const std::string& what) : Exception(what) {}
0114   };
0115 
0116 
0117   /// This feature doesn't exist yet
0118   class NotImplementedError : public Exception {
0119   public:
0120     /// Constructor with error description string
0121     NotImplementedError(const std::string& what) : Exception(what) {}
0122   };
0123 
0124   ///@}
0125 
0126 
0127 }
0128 #endif