-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(build): use custom exceptions in build (#77)
- Loading branch information
1 parent
81fccee
commit 9a19c68
Showing
7 changed files
with
165 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
class BuildException(Exception): | ||
def __init__(self, reason="", solution="", e=None): | ||
err_details = "" | ||
if e: | ||
err_details = f"Error details: {e}\n" | ||
self.message = f"{reason}\n{err_details}{solution}" | ||
super().__init__(self.message) | ||
|
||
|
||
class BuildSystemException(BuildException): | ||
def __init__(self, build_system, e=None): | ||
reason = f"Failed to build the component with the given build system '{build_system}'." | ||
solution = "Please fix the component build errors and build the component again." | ||
super().__init__(reason, solution, e) | ||
|
||
|
||
class ZipBuildRecursionException(BuildException): | ||
def __init__(self, e=None): | ||
reason = "Failed to create an archive inside the zip-build folder." | ||
solution = "Please remove symlinks in the gdk project directory if any and try again." | ||
super().__init__(reason, solution, e) | ||
|
||
|
||
class ArtifactNotFoundException(BuildException): | ||
def __init__(self, uri, e=None): | ||
reason = f"Could not find the artifact with URI '{uri}' in S3 or inside the build folders." | ||
solution = "Please check the artifact URI in the recipe and build the component again." | ||
super().__init__(reason, solution, e) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.