Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Upstream
Gitea
Commits
acb6f8a5
Commit
acb6f8a5
authored
6 years ago
by
Lanre Adelowo
Committed by
Lauris BH
6 years ago
Browse files
Options
Download
Email Patches
Plain Diff
make sure to catch the right error so it is displayed as an error on the ui not a 500 (#4945)
parent
f6eb669b
main
release/v1.10
release/v1.11
release/v1.12
release/v1.13
release/v1.14
release/v1.15
release/v1.16
release/v1.17
release/v1.18
release/v1.8
release/v1.9
v1.19.0-dev
v1.18.1
v1.18.0
v1.18.0-rc1
v1.18.0-rc0
v1.18.0-dev
v1.17.4
v1.17.3
v1.17.2
v1.17.1
v1.17.0
v1.17.0-rc2
v1.17.0-rc1
v1.17.0-dev
v1.16.9
v1.16.8
v1.16.7
v1.16.6
v1.16.5
v1.16.4
v1.16.3
v1.16.2
v1.16.1
v1.16.0
v1.16.0-rc1
v1.16.0-dev
v1.15.11
v1.15.10
v1.15.9
v1.15.8
v1.15.7
v1.15.6
v1.15.5
v1.15.4
v1.15.3
v1.15.2
v1.15.1
v1.15.0
v1.15.0-rc3
v1.15.0-rc2
v1.15.0-rc1
v1.15.0-dev
v1.14.7
v1.14.6
v1.14.5
v1.14.4
v1.14.3
v1.14.2
v1.14.1
v1.14.0
v1.14.0-rc2
v1.14.0-rc1
v1.14.0-dev
v1.13.7
v1.13.6
v1.13.5
v1.13.4
v1.13.3
v1.13.2
v1.13.1
v1.13.0
v1.13.0-rc2
v1.13.0-rc1
v1.13.0-dev
v1.12.6
v1.12.5
v1.12.4
v1.12.3
v1.12.2
v1.12.1
v1.12.0
v1.12.0-rc2
v1.12.0-rc1
v1.12.0-dev
v1.11.8
v1.11.7
v1.11.6
v1.11.5
v1.11.4
v1.11.3
v1.11.2
v1.11.1
v1.11.0
v1.11.0-rc2
v1.11.0-rc1
v1.11.0-dev
v1.10.6
v1.10.5
v1.10.4
v1.10.3
v1.10.2
v1.10.1
v1.10.0
v1.10.0-rc2
v1.10.0-rc1
v1.10.0-dev
v1.9.6
v1.9.5
v1.9.4
v1.9.3
v1.9.2
v1.9.1
v1.9.0
v1.9.0-rc2
v1.9.0-rc1
v1.9.0-dev
v1.8.3
v1.8.2
v1.8.1
v1.8.0
v1.8.0-rc3
v1.8.0-rc2
v1.8.0-rc1
v1.7.6
v1.7.5
v1.7.4
v1.7.3
v1.7.2
v1.7.1
v1.7.0
v1.7.0-rc3
v1.7.0-rc2
v1.7.0-rc1
v1.7.0-dev
v1.6.4
v1.6.3
v1.6.2
v1.6.1
v1.6.0
v1.6.0-rc2
v1.6.0-rc1
v1.6.0-dev
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
models/ssh_key.go
+1
-1
models/ssh_key.go
routers/repo/setting.go
+1
-1
routers/repo/setting.go
with
2 additions
and
2 deletions
+2
-2
models/ssh_key.go
View file @
acb6f8a5
...
...
@@ -732,7 +732,7 @@ func AddDeployKey(repoID int64, name, content string, readOnly bool) (*DeployKey
key
,
err
:=
addDeployKey
(
sess
,
pkey
.
ID
,
repoID
,
name
,
pkey
.
Fingerprint
,
accessMode
)
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"addDeployKey: %v"
,
err
)
return
nil
,
err
}
return
key
,
sess
.
Commit
()
...
...
This diff is collapsed.
Click to expand it.
routers/repo/setting.go
View file @
acb6f8a5
...
...
@@ -586,7 +586,7 @@ func DeployKeysPost(ctx *context.Context, form auth.AddKeyForm) {
if
err
!=
nil
{
ctx
.
Data
[
"HasError"
]
=
true
switch
{
case
models
.
IsErrKeyAlreadyExist
(
err
)
:
case
models
.
IsErr
Deploy
KeyAlreadyExist
(
err
)
:
ctx
.
Data
[
"Err_Content"
]
=
true
ctx
.
RenderWithErr
(
ctx
.
Tr
(
"repo.settings.key_been_used"
),
tplDeployKeys
,
&
form
)
case
models
.
IsErrKeyNameAlreadyUsed
(
err
)
:
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help