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 09:08:54 +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 09:08:54 +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 09:08:54 +01:00
|
|
|
type EmptyContentError struct {
|
2024-05-31 00:11:02 +01:00
|
|
|
ResourceType string
|
2024-06-02 09:08:54 +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-05-30 18:46:33 +01:00
|
|
|
|
|
|
|
type InvalidStatusVisibilityError struct {
|
|
|
|
Visibility string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e InvalidStatusVisibilityError) Error() string {
|
|
|
|
return "'" + e.Visibility + "' is an invalid status visibility (valid values are public, unlisted, private, mutuals_only and direct)"
|
|
|
|
}
|
|
|
|
|
|
|
|
type InvalidStatusContentTypeError struct {
|
|
|
|
ContentType string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e InvalidStatusContentTypeError) Error() string {
|
|
|
|
return "'" + e.ContentType + "' is an invalid status content type (valid values are plain and markdown)"
|
|
|
|
}
|