errors

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package errors represents base tron error struct and parsing method.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Message string         `json:"message"`
	Details []ErrorDetails `json:"details"`
	// contains filtered or unexported fields
}

Error represents base error struct.

func ParseError

func ParseError(err error) *Error

ParseError parse error to Error struct. Support lissteron/simplerr and ozzo-validation packages.

func (*Error) Error added in v0.8.0

func (e *Error) Error() string

Error returns error string.

func (*Error) GRPCStatus added in v0.8.0

func (e *Error) GRPCStatus() *status.Status

GRPCStatus build status.Status from current error.

func (*Error) HTTPStatus added in v0.8.0

func (e *Error) HTTPStatus() int

HTTPStatus return http status for error.

type ErrorDetails added in v0.8.0

type ErrorDetails struct {
	Code   string `json:"code"`
	Detail string `json:"detail"`
}

ErrorDetails represents error details.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL