-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathexceptions.py
More file actions
26 lines (15 loc) · 872 Bytes
/
exceptions.py
File metadata and controls
26 lines (15 loc) · 872 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
"""Exceptions raised from the cookiecutter workflow"""
class CookiecutterErrorException(Exception):
fmt = "An unspecified error occurred"
def __init__(self, **kwargs): # type: ignore
msg: str = self.fmt.format(**kwargs)
Exception.__init__(self, msg)
self.kwargs = kwargs
class GenerateProjectFailedError(CookiecutterErrorException):
fmt = "An error occurred while generating project from the template {template}: {provider_error}"
class InvalidLocationError(CookiecutterErrorException):
fmt = "The template location specified is not valid: {template}"
class PreprocessingError(CookiecutterErrorException):
fmt = "An error occurred while preprocessing {template}: {provider_error}"
class PostprocessingError(CookiecutterErrorException):
fmt = "An error occurred while postprocessing {template}: {provider_error}"