Revision 6797ec29 lib/errors.py

b/lib/errors.py
241 241
  """Job queue error.
242 242

  
243 243
  """
244

  
245

  
246
# errors should be added above
247

  
248

  
249
def GetErrorClass(name):
250
  """Return the class of an exception.
251

  
252
  Given the class name, return the class itself.
253

  
254
  @type name: str
255
  @param name: the exception name
256
  @rtype: class
257
  @return: the actual class, or None if not found
258

  
259
  """
260
  item = globals().get(name, None)
261
  if item is not None:
262
    if not (isinstance(item, type(Exception)) and
263
            issubclass(item, GenericError)):
264
      item = None
265
  return item

Also available in: Unified diff