diff options
author | Unknwon <u@gogs.io> | 2015-08-20 04:31:28 +0800 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-08-20 04:31:28 +0800 |
commit | 371572cf5f853211fb11bb28bc41658119d3e247 (patch) | |
tree | 68530957b87dbc2f659d4a155bbec41bb557c033 /models/error.go | |
parent | f114f7874303d249b2956c894b1a90b042430acf (diff) | |
download | gitea-371572cf5f853211fb11bb28bc41658119d3e247.tar.gz gitea-371572cf5f853211fb11bb28bc41658119d3e247.zip |
allow edit issue and comment
Diffstat (limited to 'models/error.go')
-rw-r--r-- | models/error.go | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/models/error.go b/models/error.go index c3e4806361..914aec8e79 100644 --- a/models/error.go +++ b/models/error.go @@ -258,7 +258,27 @@ func IsErrIssueNotExist(err error) bool { } func (err ErrIssueNotExist) Error() string { - return fmt.Sprintf("issue does not exist [id: %d, repo_id: %d, index: %4]", err.ID, err.RepoID, err.Index) + return fmt.Sprintf("issue does not exist [id: %d, repo_id: %d, index: %d]", err.ID, err.RepoID, err.Index) +} + +// _________ __ +// \_ ___ \ ____ _____ _____ ____ _____/ |_ +// / \ \/ / _ \ / \ / \_/ __ \ / \ __\ +// \ \___( <_> ) Y Y \ Y Y \ ___/| | \ | +// \______ /\____/|__|_| /__|_| /\___ >___| /__| +// \/ \/ \/ \/ \/ + +type ErrCommentNotExist struct { + ID int64 +} + +func IsErrCommentNotExist(err error) bool { + _, ok := err.(ErrCommentNotExist) + return ok +} + +func (err ErrCommentNotExist) Error() string { + return fmt.Sprintf("comment does not exist [id: %d]", err.ID) } // .____ ___. .__ |