Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Add Exception to CommandError for the better error message. #78

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions websockets/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ type Syncer interface {
}

type CommandError struct {
Name string `json:"error"`
Code int `json:"error_code"`
Message string `json:"error_message"`
Name string `json:"error"`
Code int `json:"error_code"`
Message string `json:"error_message"`
Exception string `json:"error_exception"`
}

type Command struct {
Expand Down Expand Up @@ -48,7 +49,7 @@ func (c *Command) IncrementId() {
}

func (e *CommandError) Error() string {
return fmt.Sprintf("%s %d %s", e.Name, e.Code, e.Message)
return fmt.Sprintf("%s %d %s %s", e.Name, e.Code, e.Message, e.Exception)
}

func newCommand(command string) *Command {
Expand Down