jerr

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RuntimeFailure = "runtime failure" // should not occur
	TestFakeError  = "fake error"

	HTTPResourceNotFound    = "resource not found"
	HTTPMethodNotFound      = "HTTP method not found"
	PathNotFound            = "path not found"
	TagNotFound             = "tag not found"
	UserTypeNotFound        = "user type not found"
	ParentNotFound          = "parent directive not found"
	MacroNotFound           = "macro not found"
	ServerNotFound          = "server not found"
	JsonRpcMethodNotFound   = "JSON-RPC method not found"
	JsonRpcResourceNotFound = "resource not found"

	ProtocolNotFound     = `the directive "Protocol" not found`
	ProtocolParameterErr = `the parameter value have to be "json-rpc-2.0"`

	InfoIsEmpty        = "the INFO directive cannot be empty"
	ResponsesIsEmpty   = "the response cannot be empty"
	RequestIsEmpty     = "the request cannot be empty"
	DescriptionIsEmpty = "" //nolint:lll
	/* 141-byte string literal not displayed */
	BodyIsEmpty  = "the body cannot be empty"
	MacroIsEmpty = "the macros cannot be empty, learn more about the MACRO directive here: https://jsight.io/docs/jsight-api-0-3#directive-macro" //nolint:lll

	IncorrectPath             = "incorrect path"
	IncorrectRequest          = "incorrect request"
	IncorrectDirectiveContext = "incorrect context for the directive"
	IncorrectParameter        = "incorrect parameter"

	PathOrErr     = "the root schema object cannot have the `or` rule in the Path directive"
	PathObjectErr = "" //nolint:lll
	/* 144-byte string literal not displayed */
	PathAdditionalPropertiesErr = `` //nolint:lll
	/* 168-byte string literal not displayed */
	PathNullableErr = `` //nolint:lll
	/* 156-byte string literal not displayed */
	PathEmptyErr = "" //nolint:lll
	/* 145-byte string literal not displayed */
	PathMultiLevelPropertyErr          = "the multi-level property is not allowed in the Path directive"
	PathEmptyParameter                 = "empty PATH parameter"
	PathParameterIsDuplicatedInThePath = "the parameter of the path is duplicated"
	PathsAreSimilar                    = "" //nolint:lll
	/* 129-byte string literal not displayed */
	PathParameterAlreadyDefined = "" //nolint:lll
	/* 148-byte string literal not displayed */

	IncludeRootErr      = "cannot not start with `/`"
	IncludeUpErr        = "cannot contain `..` or `.`"
	IncludeSeparatorErr = "directories must be separated by slashes `/`"
	IncludeDirectiveErr = "the directive is not allowed in included files:"

	UnsupportedVersion                = "The specified JSight version is not supported"
	DirectiveJSIGHTShouldBeTheFirst   = "The first directive in the document must be JSIGHT"
	DirectiveJSIGHTGottaBeOnlyOneTime = "The directive JSIGHT has already been specified before"
	DirectiveINFOGottaBeOnlyOneTime   = "The directive INFO has already been specified before"
	DirectiveBaseURLAlreadyDefined    = "The directive BaseUrl has already been defined before"

	UnknownDirective = "unknown directive"
	UnknownNotation  = "unknown notation"

	RequiredParameterNotSpecified         = "required parameter(s) not specified"
	ParametersAreForbiddenForTheDirective = "the directive should not have parameters in this case"
	ParametersIsAlreadyDefined            = "the parameter %q is already defined for the directive"

	AnnotationIsForbiddenForTheDirective                = "the annotation is not allowed for this directive"
	NotUniqueDirective                                  = "the directive has already been defined"
	NotUniquePath                                       = "the path %q has already been defined"
	BodyMustBeObject                                    = "there must be an object or a reference to an object in the directive body"          //nolint:lll
	CannotUseTheTypeAndSchemaNotationParametersTogether = "directive parameters `Type` and `SchemaNotation` cannot be declared simultaneously" //nolint:lll
	ThereIsNoExplicitContextForClosure                  = ""                                                                                   //nolint:lll
	/* 182-byte string literal not displayed */
	DirectiveNotAllowed            = "the directive is not allowed"
	ApartFromTheOpeningParenthesis = "" //nolint:lll
	/* 213-byte string literal not displayed */
	DuplicateNames                  = "the name %q has already been declared before"
	NotAllowedToOverrideTheProperty = "it is not allowed to override the %q property from the user type %q" //nolint:lll
	ContextNotClosed                = ""                                                                    //nolint:lll
	/* 174-byte string literal not displayed */
	WrongDescriptionContext          = "wrong description context"
	MethodIsAlreadyDefinedInResource = "this method has already been defined in the resource"
	UndefinedRequestBodyForResource  = "undefined request body for resource"
	RecursionIsProhibited            = "" //nolint:lll
	/* 139-byte string literal not displayed */
	UserTypeIsNotAnObject       = "the user type is not an object"
	ProcessTypeErr              = "process type"
	FailedToComputeScannersHash = "failed to compute the scanner's hash"
)

Variables

This section is empty.

Functions

func GetQuote

func GetQuote(content bytes.Bytes, position bytes.Index) string

GetQuote return "" if the source sub-string cannot be determined

Types

type JApiError

type JApiError struct {
	Msg string

	Location
	// contains filtered or unexported fields
}

func NewJApiError

func NewJApiError(msg string, f *fs.File, i bytes.Index) *JApiError

func (*JApiError) Error

func (e *JApiError) Error() string

func (*JApiError) HasStackTrace

func (e *JApiError) HasStackTrace() bool

func (*JApiError) OccurredInFile

func (e *JApiError) OccurredInFile(f *fs.File, atByte bytes.Index)

type Location

type Location struct {
	File   *fs.File
	Quote  string
	Index  bytes.Index
	Line   bytes.Index
	Column bytes.Index
}

func NewLocation

func NewLocation(f *fs.File, i bytes.Index) Location

NewLocation a bit optimized version of getting all info

Jump to

Keyboard shortcuts

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