diff --git a/deploy_error.go b/deploy_error.go index 5523859..7916e78 100644 --- a/deploy_error.go +++ b/deploy_error.go @@ -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