Add DeployError.ToString() (fix #43)
This commit is contained in:
parent
e855c3e630
commit
b15b5b7be1
@ -15,9 +15,13 @@ type DeployError struct {
|
||||
|
||||
// SendOverMatrix provides an easy way to send the contents of a DeployError over Matrix
|
||||
func (deploy_error *DeployError) SendOverMatrix() {
|
||||
sendMessage(MatrixMessage{text: fmt.Sprintf("%s**Error in **`%s`**!**\n- *%s*\n- Code: %d",
|
||||
Circles["red"], deploy_error.where, deploy_error.details, deploy_error.code),
|
||||
})
|
||||
sendMessage(MatrixMessage{text: deploy_error.ToString()})
|
||||
}
|
||||
|
||||
// ToString converts a DeployError into a human readable string.
|
||||
func (deploy_error *DeployError) ToString() string {
|
||||
return fmt.Sprintf("%sError in `%s`! (%s) Code: %d",
|
||||
Circles["red"], deploy_error.where, deploy_error.details, deploy_error.code)
|
||||
}
|
||||
|
||||
// newDeployError creates a DeployError
|
||||
|
Loading…
Reference in New Issue
Block a user