watchtower/wtwire/error_code: add shared error codes

This commit is contained in:
Conner Fromknecht 2018-10-23 18:28:23 -07:00
parent 999466c860
commit 9ab620c7be
No known key found for this signature in database
GPG Key ID: E7D737B67FA592C7

View File

@ -0,0 +1,20 @@
package wtwire
// ErrorCode represents a generic error code used when replying to watchtower
// clients. Specific reply messages may extend the ErrorCode primitive and add
// custom codes, so long as they don't collide with the generic error codes..
type ErrorCode uint16
const (
// CodeOK signals that the request was successfully processed by the
// watchtower.
CodeOK ErrorCode = 0
// CodeTemporaryFailure alerts the client that the watchtower is
// temporarily unavailable, but that it may try again at a later time.
CodeTemporaryFailure ErrorCode = 40
// CodePermanentFailure alerts the client that the watchtower has
// permanently failed, and further communication should be avoided.
CodePermanentFailure ErrorCode = 50
)