struct Twirp::Twerr

Overview

Struct used to serialize and deserialize Twirp's JSON serialization of errors

Included Modules

Defined in:

twirp/error.cr

Constant Summary

CODE_TO_ERROR = {"invalid_argument" => Error::InvalidArgument, "malformed" => Error::Malformed, "out_of_range" => Error::OutOfRange, "unauthenticated" => Error::Unauthenticated, "permission_denied" => Error::PermissionDenied, "not_found" => Error::NotFound, "bad_route" => Error::BadRoute, "canceled" => Error::Canceled, "deadline_exceeded" => Error::DeadlineExceeded, "already_exists" => Error::AlreadyExists, "aborted" => Error::Aborted, "failed_precondition" => Error::FailedPrecondition, "resource_exhausted" => Error::ResourceExhausted, "unknown" => Error::Unknown, "internal" => Error::InvalidArgument, "dataloss" => Error::Dataloss, "unimplemented" => Error::Unimplemented, "unavailable" => Error::Unavailable}

Constructors

Instance Method Summary

Constructor Detail

def self.new(code : String, msg : Nil | String) #

[View source]
def self.new(pull : JSON::PullParser) #

[View source]

Instance Method Detail

def code : String #

[View source]
def meta : Hash(String, JSON::Any) | Nil #

[View source]
def msg : String | Nil #

[View source]
def to_err : Twirp::Error #

[View source]