mirror of https://github.com/hashicorp/boundary
(fix) added more context to error details for cli command (#2170)
* (test) added more context to error details for cli commands * (fix) refactor solution to utilize custom error type casting * (test) added api unit test to validate InvalidArgumentError return message * Update internal/types/subtypes/error.go Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com> * (refactor) rename InvalidArgumentError into UnknownSubtypeIDError Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>pull/2183/head
parent
1da2cf06b0
commit
3441fa0447
@ -0,0 +1,15 @@
|
||||
package subtypes
|
||||
|
||||
// UnknownSubtypeIDError is an error type that describes an invalid
|
||||
// resource sub-type identifer. For example, this authentication sub-type
|
||||
// ID "ampwd_1234567890" is an error because the prefix "ampwd" is invalid.
|
||||
type UnknownSubtypeIDError struct {
|
||||
// ID is the resource identifier
|
||||
ID string
|
||||
}
|
||||
|
||||
// Error returns a string describing an unknown subtype based on a given resource ID
|
||||
// Example: "unknown subtype in ID: ampwd_1234567890"
|
||||
func (e *UnknownSubtypeIDError) Error() string {
|
||||
return "unknown subtype in ID: " + e.ID
|
||||
}
|
||||
Loading…
Reference in new issue