* Fix 500 Error with branch and tag sharing the same name #15592 Fixed 500 error while create Pull request when there are more than one sources (branch, tag) with the same name Fix #15592 Signed-off-by: Viktor Yakovchuk <viktor@yakovchuk.net> * fix logging Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
parent
f2babf3346
commit
08f4b3f312
3 changed files with 37 additions and 1 deletions
|
@ -159,3 +159,20 @@ func (err *ErrPushRejected) GenerateMessage() {
|
|||
}
|
||||
err.Message = strings.TrimSpace(messageBuilder.String())
|
||||
}
|
||||
|
||||
// ErrMoreThanOne represents an error if pull request fails when there are more than one sources (branch, tag) with the same name
|
||||
type ErrMoreThanOne struct {
|
||||
StdOut string
|
||||
StdErr string
|
||||
Err error
|
||||
}
|
||||
|
||||
// IsErrMoreThanOne checks if an error is a ErrMoreThanOne
|
||||
func IsErrMoreThanOne(err error) bool {
|
||||
_, ok := err.(*ErrMoreThanOne)
|
||||
return ok
|
||||
}
|
||||
|
||||
func (err *ErrMoreThanOne) Error() string {
|
||||
return fmt.Sprintf("ErrMoreThanOne Error: %v: %s\n%s", err.Err, err.StdErr, err.StdOut)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue