Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
redminems
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tgms
redminems
Commits
408a850b
Commit
408a850b
authored
7 years ago
by
Anatolii Prylutskyi
Browse files
Options
Downloads
Patches
Plain Diff
Add logs for debuging
parent
0fb7fc9b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tracker/util.go
+8
-1
8 additions, 1 deletion
tracker/util.go
with
8 additions
and
1 deletion
tracker/util.go
+
8
−
1
View file @
408a850b
...
...
@@ -14,6 +14,7 @@ import (
"github.com/pkg/errors"
"gitlab.qarea.org/bkp/cfg"
"gitlab.qarea.org/tgms/ctxtg"
"gitlab.qarea.org/tgms/redminems/entities"
)
...
...
@@ -68,6 +69,12 @@ func redmineRequest(opts requestOpts) error {
if
err
!=
nil
{
return
errors
.
Wrap
(
err
,
"failed read body"
)
}
if
cfg
.
Debug
{
bodyBytes
,
_
:=
json
.
Marshal
(
opts
.
body
)
log
.
DEBUG
(
"Login: %v
\n
Request: %v
\n
Response: %v
\n
"
,
opts
.
tracker
.
Credentials
.
Login
,
string
(
bodyBytes
),
string
(
b
))
}
if
resp
.
StatusCode
==
422
{
return
errors
.
Wrapf
(
toExternalServiceErr
(
b
),
"invalid object passed to redmine, response body: %s"
,
string
(
b
))
}
...
...
@@ -88,7 +95,7 @@ func redmineRequest(opts requestOpts) error {
return
nil
}
func
validateStatusCodes
(
expected
...
int
)
func
(
s
int
)
error
{
func
validateStatusCodes
(
expected
...
int
)
func
(
int
)
error
{
return
func
(
s
int
)
error
{
for
_
,
e
:=
range
expected
{
if
s
==
e
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment