2024-06-02 07:53:13 +01:00
|
|
|
// SPDX-FileCopyrightText: 2024 Dan Anglin <d.n.i.anglin@gmail.com>
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2024-05-23 18:06:49 +01:00
|
|
|
package executor
|
|
|
|
|
|
|
|
type FlagNotSetError struct {
|
|
|
|
flagText string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e FlagNotSetError) Error() string {
|
2024-06-02 11:35:43 +01:00
|
|
|
return "please use the required --" + e.flagText + " flag"
|
2024-05-23 18:06:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
type UnsupportedTypeError struct {
|
|
|
|
resourceType string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e UnsupportedTypeError) Error() string {
|
2024-06-02 11:35:43 +01:00
|
|
|
return "'" + e.resourceType + "' is not supported for this operation"
|
2024-05-23 18:06:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
type NoAccountSpecifiedError struct{}
|
|
|
|
|
|
|
|
func (e NoAccountSpecifiedError) Error() string {
|
|
|
|
return "no account specified in this request"
|
|
|
|
}
|
|
|
|
|
|
|
|
type UnsupportedAddOperationError struct {
|
|
|
|
ResourceType string
|
|
|
|
AddToResourceType string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e UnsupportedAddOperationError) Error() string {
|
|
|
|
return "adding '" + e.ResourceType + "' to '" + e.AddToResourceType + "' is not supported"
|
|
|
|
}
|
|
|
|
|
|
|
|
type UnsupportedRemoveOperationError struct {
|
|
|
|
ResourceType string
|
|
|
|
RemoveFromResourceType string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e UnsupportedRemoveOperationError) Error() string {
|
|
|
|
return "removing '" + e.ResourceType + "' from '" + e.RemoveFromResourceType + "' is not supported"
|
|
|
|
}
|
|
|
|
|
2024-06-02 11:35:43 +01:00
|
|
|
type EmptyContentError struct {
|
2024-05-31 00:11:02 +01:00
|
|
|
ResourceType string
|
2024-06-02 11:35:43 +01:00
|
|
|
Hint string
|
2024-05-31 00:11:02 +01:00
|
|
|
}
|
2024-05-23 18:06:49 +01:00
|
|
|
|
|
|
|
func (e EmptyContentError) Error() string {
|
2024-05-31 00:11:02 +01:00
|
|
|
message := "the content of this " + e.ResourceType + " should not be empty"
|
|
|
|
|
|
|
|
if e.Hint != "" {
|
|
|
|
message += ", " + e.Hint
|
|
|
|
}
|
|
|
|
|
|
|
|
return message
|
2024-05-23 18:06:49 +01:00
|
|
|
}
|
2024-06-10 18:59:01 +01:00
|
|
|
|
|
|
|
type UnknownCommandError struct {
|
|
|
|
Command string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e UnknownCommandError) Error() string {
|
|
|
|
return "unknown command '" + e.Command + "'"
|
|
|
|
}
|
2024-06-12 17:45:32 +01:00
|
|
|
|
|
|
|
type ExpiredPollError struct{}
|
|
|
|
|
|
|
|
func (e ExpiredPollError) Error() string {
|
|
|
|
return "this poll has expired"
|
|
|
|
}
|
|
|
|
|
|
|
|
type MultipleChoiceError struct{}
|
|
|
|
|
|
|
|
func (e MultipleChoiceError) Error() string {
|
|
|
|
return "this poll does not allow multiple choices"
|
|
|
|
}
|