Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
Assignment 1
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Aksel Baardsen
Assignment 1
Commits
2a43c0fd
Commit
2a43c0fd
authored
5 years ago
by
Aksel Baardsen
Browse files
Options
Downloads
Patches
Plain Diff
Added comments
parent
02913859
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
handler/country.go
+1
-1
1 addition, 1 deletion
handler/country.go
handler/diag.go
+1
-1
1 addition, 1 deletion
handler/diag.go
handler/species.go
+1
-1
1 addition, 1 deletion
handler/species.go
pkg/diag.go
+2
-0
2 additions, 0 deletions
pkg/diag.go
with
5 additions
and
3 deletions
handler/country.go
+
1
−
1
View file @
2a43c0fd
...
...
@@ -27,6 +27,6 @@ func Chandler(w http.ResponseWriter, r *http.Request) {
}
}
else
{
// need to check error for content when setting header (pkg.CorrectHeader)
http
.
Error
(
w
,
"An error occured"
,
pkg
.
CorrectHeader
(
err
))
http
.
Error
(
w
,
"An error occur
r
ed"
,
pkg
.
CorrectHeader
(
err
))
}
}
This diff is collapsed.
Click to expand it.
handler/diag.go
+
1
−
1
View file @
2a43c0fd
...
...
@@ -11,7 +11,7 @@ func Dhandler(w http.ResponseWriter, r *http.Request) {
var
diagnostics
pkg
.
Diag
if
err
:=
pkg
.
GetDiag
(
&
diagnostics
);
err
!=
nil
{
http
.
Error
(
w
,
"An error occured"
,
http
.
StatusBadGateway
)
http
.
Error
(
w
,
"An error occur
r
ed"
,
http
.
StatusBadGateway
)
}
w
.
Header
()
.
Set
(
"Content-Type"
,
"application/json"
)
...
...
This diff is collapsed.
Click to expand it.
handler/species.go
+
1
−
1
View file @
2a43c0fd
...
...
@@ -21,6 +21,6 @@ func Shandler(w http.ResponseWriter, r *http.Request) {
}
}
else
{
w
.
WriteHeader
(
pkg
.
CorrectHeader
(
err
))
_
,
_
=
fmt
.
Fprintln
(
w
,
"An error occured"
)
_
,
_
=
fmt
.
Fprintln
(
w
,
"An error occur
r
ed"
)
}
}
This diff is collapsed.
Click to expand it.
pkg/diag.go
+
2
−
0
View file @
2a43c0fd
...
...
@@ -36,6 +36,7 @@ func GetDiag(d* Diag) error {
return
nil
}
// Gets GBIF-api status code
func
getGbifStatus
(
d
*
Diag
)
error
{
resp
,
err
:=
http
.
Get
(
gbifApi
)
if
err
!=
nil
{
...
...
@@ -45,6 +46,7 @@ func getGbifStatus(d *Diag) error {
return
nil
}
// Gets country-api status code
func
getRestStatus
(
d
*
Diag
)
error
{
resp
,
err
:=
http
.
Get
(
restApi
)
if
err
!=
nil
{
...
...
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