Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
imghost
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Janne Mareike Koschinski
imghost
Commits
ecfd7051
Verified
Commit
ecfd7051
authored
2 years ago
by
Janne Mareike Koschinski
Browse files
Options
Downloads
Patches
Plain Diff
fix: improve error logging
parent
619f66cc
No related branches found
No related tags found
No related merge requests found
Pipeline
#2805
passed
2 years ago
Stage: build
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
backend/main.go
+2
-0
2 additions, 0 deletions
backend/main.go
frontend/main.go
+2
-0
2 additions, 0 deletions
frontend/main.go
shared/error.go
+9
-0
9 additions, 0 deletions
shared/error.go
with
13 additions
and
0 deletions
backend/main.go
+
2
−
0
View file @
ecfd7051
...
...
@@ -24,6 +24,8 @@ var imageProcessDurationResize = imageProcessDuration.WithLabelValues("resize")
var
imageProcessDurationWrite
=
imageProcessDuration
.
WithLabelValues
(
"write"
)
func
main
()
{
defer
shared
.
ErrorHandler
()
configFile
,
err
:=
os
.
Open
(
"config.yaml"
)
if
err
!=
nil
{
log
.
Fatalf
(
"error opening config file: %s"
,
err
.
Error
())
...
...
This diff is collapsed.
Click to expand it.
frontend/main.go
+
2
−
0
View file @
ecfd7051
...
...
@@ -12,6 +12,8 @@ import (
)
func
main
()
{
defer
shared
.
ErrorHandler
()
configFile
,
err
:=
os
.
Open
(
"config.yaml"
)
if
err
!=
nil
{
log
.
Fatalf
(
"error opening config file: %s"
,
err
.
Error
())
...
...
This diff is collapsed.
Click to expand it.
shared/error.go
0 → 100644
+
9
−
0
View file @
ecfd7051
package
shared
import
"log"
func
ErrorHandler
()
{
if
err
:=
recover
();
err
!=
nil
{
log
.
Fatalf
(
"error occured unexpectedly: %s"
,
err
)
}
}
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