Blame pagure/exceptions.py
|
Pierre-Yves Chibon |
33b534 |
# -*- coding: utf-8 -*-
|
|
Pierre-Yves Chibon |
6420e6 |
|
|
Pierre-Yves Chibon |
6420e6 |
"""
|
|
Pierre-Yves Chibon |
6420e6 |
(c) 2014 - Copyright Red Hat Inc
|
|
Pierre-Yves Chibon |
6420e6 |
|
|
Pierre-Yves Chibon |
6420e6 |
Authors:
|
|
Pierre-Yves Chibon |
6420e6 |
Pierre-Yves Chibon <pingou@pingoured.fr></pingou@pingoured.fr>
|
|
Pierre-Yves Chibon |
6420e6 |
|
|
Pierre-Yves Chibon |
6420e6 |
"""
|
|
Pierre-Yves Chibon |
6420e6 |
|
|
Pierre-Yves Chibon |
6420e6 |
|
|
Pierre-Yves Chibon |
fe5017 |
class PagureException(Exception):
|
|
Pierre-Yves Chibon |
fe5017 |
''' Parent class of all the exception for all Pagure specific
|
|
Pierre-Yves Chibon |
6420e6 |
exceptions.
|
|
Pierre-Yves Chibon |
6420e6 |
'''
|
|
Pierre-Yves Chibon |
6420e6 |
pass
|
|
Pierre-Yves Chibon |
6420e6 |
|
|
Pierre-Yves Chibon |
6420e6 |
|
|
Pierre-Yves Chibon |
fe5017 |
class RepoExistsException(PagureException):
|
|
Pierre-Yves Chibon |
6420e6 |
''' Exception thrown when trying to create a repository that already
|
|
Pierre-Yves Chibon |
6420e6 |
exists.
|
|
Pierre-Yves Chibon |
6420e6 |
'''
|
|
Pierre-Yves Chibon |
6420e6 |
pass
|
|
Pierre-Yves Chibon |
a753e9 |
|
|
Pierre-Yves Chibon |
a753e9 |
|
|
Pierre-Yves Chibon |
fe5017 |
class FileNotFoundException(PagureException):
|
|
Pierre-Yves Chibon |
a753e9 |
''' Exception thrown when trying to create a repository that already
|
|
Pierre-Yves Chibon |
a753e9 |
exists.
|
|
Pierre-Yves Chibon |
a753e9 |
'''
|
|
Pierre-Yves Chibon |
a753e9 |
pass
|
|
Pierre-Yves Chibon |
421a7c |
|
|
Pierre-Yves Chibon |
421a7c |
|
|
Pierre-Yves Chibon |
421a7c |
class APIError(PagureException):
|
|
Pierre-Yves Chibon |
421a7c |
''' Exception raised by the API when something goes wrong. '''
|
|
Pierre-Yves Chibon |
421a7c |
|
|
Pierre-Yves Chibon |
421a7c |
def __init__(self, status_code, error_code, error=None):
|
|
Pierre-Yves Chibon |
421a7c |
self.status_code = status_code
|
|
Pierre-Yves Chibon |
421a7c |
self.error_code = error_code
|
|
Pierre-Yves Chibon |
421a7c |
self.error = error
|
|
Pierre-Yves Chibon |
528f09 |
|
|
Pierre-Yves Chibon |
528f09 |
|
|
Pierre-Yves Chibon |
528f09 |
class BranchNotFoundException(PagureException):
|
|
Pierre-Yves Chibon |
528f09 |
''' Exception thrown when trying to use a branch that could not be
|
|
Pierre-Yves Chibon |
528f09 |
found in a repository.
|
|
Pierre-Yves Chibon |
528f09 |
'''
|
|
Pierre-Yves Chibon |
528f09 |
pass
|
|
Pierre-Yves Chibon |
6d72f7 |
|
|
Pierre-Yves Chibon |
6d72f7 |
|
|
Pierre-Yves Chibon |
6d72f7 |
class PagureEvException(PagureException):
|
|
Pierre-Yves Chibon |
6d72f7 |
''' Exceptions used in the pagure-stream-server.
|
|
Pierre-Yves Chibon |
6d72f7 |
'''
|
|
Pierre-Yves Chibon |
6d72f7 |
pass
|