summaryrefslogtreecommitdiffstats
path: root/models/error.go
diff options
context:
space:
mode:
authorJohn Olheiser <42128690+jolheiser@users.noreply.github.com>2019-09-08 03:28:40 -0500
committerLauris BH <lauris.buksis@zzdats.lv>2019-09-08 11:28:40 +0300
commit0118b6aaf8ada3edd67cb975c776f6f124178ad2 (patch)
tree8e96203d74de6c4bc7f8eb2a5751a8d218f3ffd3 /models/error.go
parentd4e11ebb18df4bd01f509f673d536e093edb124a (diff)
downloadgitea-0118b6aaf8ada3edd67cb975c776f6f124178ad2.tar.gz
gitea-0118b6aaf8ada3edd67cb975c776f6f124178ad2.zip
Add option to initialize repository with labels (#6061)
* Add optional label sets on repo creation * Fix CRLF * Instead of hardcoding default, make it the helper * Move label set init out of repo init Add a new error for the router Combine router label init with repo creation label init Signed-off-by: jolheiser <john.olheiser@gmail.com> * Add issue labels to Swagger for repo creation Signed-off-by: jolheiser <john.olheiser@gmail.com> * Update models/issue_label.go Co-Authored-By: Lauris BH <lauris@nix.lv> * Update models/issue_label.go Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
Diffstat (limited to 'models/error.go')
-rw-r--r--models/error.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/models/error.go b/models/error.go
index 11ca6e6863..cecd03f993 100644
--- a/models/error.go
+++ b/models/error.go
@@ -1058,6 +1058,22 @@ func (err ErrIssueNotExist) Error() string {
return fmt.Sprintf("issue does not exist [id: %d, repo_id: %d, index: %d]", err.ID, err.RepoID, err.Index)
}
+// ErrIssueLabelTemplateLoad represents a "ErrIssueLabelTemplateLoad" kind of error.
+type ErrIssueLabelTemplateLoad struct {
+ TemplateFile string
+ OriginalError error
+}
+
+// IsErrIssueLabelTemplateLoad checks if an error is a ErrIssueLabelTemplateLoad.
+func IsErrIssueLabelTemplateLoad(err error) bool {
+ _, ok := err.(ErrIssueLabelTemplateLoad)
+ return ok
+}
+
+func (err ErrIssueLabelTemplateLoad) Error() string {
+ return fmt.Sprintf("Failed to load label template file '%s': %v", err.TemplateFile, err.OriginalError)
+}
+
// __________ .__ .__ __________ __
// \______ \__ __| | | |\______ \ ____ ________ __ ____ _______/ |_
// | ___/ | \ | | | | _// __ \/ ____/ | \_/ __ \ / ___/\ __\