Line data Source code
1 : package constants 2 : 3 : // Sylvia-IoT error response codes. 4 : type ErrResp int 5 : 6 : // Sylvia-IoT error response codes. 7 : const ( 8 : ErrAuth ErrResp = iota 9 : ErrDB 10 : ErrIntMsg 11 : ErrNotFound 12 : ErrParam 13 : ErrPerm 14 : ErrRsc 15 : ErrUnknown 16 : ) 17 : 18 15 : func (e ErrResp) String() string { 19 15 : switch e { 20 2 : case ErrAuth: 21 2 : return "err_auth" 22 1 : case ErrDB: 23 1 : return "err_db" 24 1 : case ErrIntMsg: 25 1 : return "err_int_msg" 26 1 : case ErrNotFound: 27 1 : return "err_not_found" 28 5 : case ErrParam: 29 5 : return "err_param" 30 1 : case ErrPerm: 31 1 : return "err_perm" 32 2 : case ErrRsc: 33 2 : return "err_rsc" 34 2 : default: 35 2 : return "err_unknown" 36 : } 37 : }