-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds sentry handling and changes the initialization strategy on the logger and server for more predictable behavior.
- Loading branch information
1 parent
c7831cf
commit ca90a3a
Showing
28 changed files
with
755 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package lib | ||
|
||
import ( | ||
"github.com/getsentry/sentry-go" | ||
"github.com/gin-gonic/gin" | ||
) | ||
|
||
func SentryScope(c *gin.Context, s *sentry.Scope) { | ||
s.SetExtra("extra", "extra") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package error | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/simiancreative/simiango/server" | ||
"github.com/simiancreative/simiango/service" | ||
) | ||
|
||
var Config = service.Config{ | ||
Kind: service.DIRECT, | ||
Method: "GET", | ||
Path: "/error", | ||
Direct: direct, | ||
} | ||
|
||
func direct(req service.Req) (interface{}, error) { | ||
return nil, fmt.Errorf("this is an error") | ||
} | ||
|
||
// dont forget to import your package in your main.go for initialization | ||
// _ "path/to/project/direct" | ||
func init() { | ||
server.AddService(Config) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.