Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-shell
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-shell
Commits
f61186ba
Commit
f61186ba
authored
Feb 12, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'log-api-error' into 'master'
Log full Net::HTTP error. See merge request !56
parents
63e16172
ddb0a8d1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
7 deletions
+2
-7
lib/gitlab_net.rb
lib/gitlab_net.rb
+2
-1
lib/gitlab_shell.rb
lib/gitlab_shell.rb
+0
-1
spec/gitlab_shell_spec.rb
spec/gitlab_shell_spec.rb
+0
-5
No files found.
lib/gitlab_net.rb
View file @
f61186ba
...
...
@@ -101,7 +101,8 @@ class GitlabNet
begin
response
=
http
.
start
{
http
.
request
(
request
)
}
rescue
rescue
=>
e
$logger
.
warn
"Failed to connect to internal API <
#{
method
.
to_s
.
upcase
}
#{
url
}
>:
#{
e
.
inspect
}
"
raise
ApiUnreachableError
end
...
...
lib/gitlab_shell.rb
View file @
f61186ba
...
...
@@ -36,7 +36,6 @@ class GitlabShell
puts
"Welcome to GitLab,
#{
username
}
!"
end
rescue
GitlabNet
::
ApiUnreachableError
=>
ex
$logger
.
warn
"gitlab-shell: Failed to connect to internal API"
puts
"Failed to authorize your Git request: internal API unreachable"
rescue
DisallowedCommandError
=>
ex
message
=
"gitlab-shell: Attempt to execute disallowed command <
#{
@origin_cmd
}
> by
#{
log_username
}
."
...
...
spec/gitlab_shell_spec.rb
View file @
f61186ba
...
...
@@ -150,11 +150,6 @@ describe GitlabShell do
it
"should not execute the command"
do
subject
.
should_not_receive
(
:exec_cmd
)
end
it
"should log the failed connection"
do
message
=
"gitlab-shell: Failed to connect to internal API"
$logger
.
should_receive
(
:warn
).
with
(
message
)
end
end
end
...
...
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