github.com/blend/go-sdk@v1.20220411.3/webutil/errors.go (about) 1 /* 2 3 Copyright (c) 2022 - Present. Blend Labs, Inc. All rights reserved 4 Use of this source code is governed by a MIT license that can be found in the LICENSE file. 5 6 */ 7 8 package webutil 9 10 import "github.com/blend/go-sdk/ex" 11 12 // Errors 13 const ( 14 ErrInvalidSameSite ex.Class = "invalid cookie same site string value" 15 ErrParameterMissing ex.Class = "parameter missing" 16 ErrUnauthorized ex.Class = "unauthorized" 17 ErrInvalidSplitColonInput ex.Class = `split colon input string is not of the form "<first>:<second>"` 18 ) 19 20 // ErrIsInvalidSameSite returns if an error is `ErrInvalidSameSite` 21 func ErrIsInvalidSameSite(err error) bool { 22 return ex.Is(err, ErrInvalidSameSite) 23 } 24 25 // ErrIsParameterMissing returns if an error is `ErrParameterMissing` 26 func ErrIsParameterMissing(err error) bool { 27 return ex.Is(err, ErrParameterMissing) 28 } 29 30 // ErrIsUnauthorized returns if an error is `ErrUnauthorized` 31 func ErrIsUnauthorized(err error) bool { 32 return ex.Is(err, ErrUnauthorized) 33 } 34 35 // ErrIsInvalidSplitColonInput returns if an error is `ErrInvalidSplitColonInput` 36 func ErrIsInvalidSplitColonInput(err error) bool { 37 return ex.Is(err, ErrInvalidSplitColonInput) 38 }