examples: Add chat example that also doesn't work properly yet
This commit is contained in:
11
examples/chat/error.go
Normal file
11
examples/chat/error.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package chat
|
||||
|
||||
import "fmt"
|
||||
|
||||
func (msg *MessageError) Error() string {
|
||||
if description, ok := msg.Description.Get(); ok {
|
||||
return fmt.Sprintf("other party sent error: %d %s", msg.Error, description)
|
||||
} else {
|
||||
return fmt.Sprintf("other party sent error: %d", msg.Code)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user