This repository has been archived by the owner on Jun 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d212bd7
commit 87f4273
Showing
2 changed files
with
40 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package parser | ||
|
||
import "fmt" | ||
|
||
type ErrNotCloudFormation struct { | ||
source string | ||
} | ||
|
||
func NewErrNotCloudFormation(source string) *ErrNotCloudFormation { | ||
return &ErrNotCloudFormation{ | ||
source: source, | ||
} | ||
} | ||
|
||
func (e *ErrNotCloudFormation) Error() string { | ||
return fmt.Sprintf("The file %s is not CloudFormation", e.source) | ||
} | ||
|
||
type ErrInvalidContent struct { | ||
source string | ||
err error | ||
} | ||
|
||
func NewErrInvalidContent(source string, err error) *ErrInvalidContent { | ||
return &ErrInvalidContent{ | ||
source: source, | ||
err: err, | ||
} | ||
} | ||
func (e *ErrInvalidContent) Error() string { | ||
return fmt.Sprintf("Invalid content in file: %s", e.source) | ||
} | ||
|
||
func (e *ErrInvalidContent) Reason() error { | ||
return e.err | ||
} |
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