MCPcopy
hub / github.com/superplanehq/superplane / Setup

Method Setup

pkg/registry/trigger.go:68–78  ·  view source on GitHub ↗

* * Panicking methods. * These are where the component logic is implemented, * so they could panic, and if they do, the system shouldn't crash. */

(ctx core.TriggerContext)

Source from the content-addressed store, hash-verified

66 * so they could panic, and if they do, the system shouldn't crash.
67 */
68func (s *PanicableTrigger) Setup(ctx core.TriggerContext) (err error) {
69 defer func() {
70 if r := recover(); r != nil {
71 ctx.Logger.Errorf("Trigger %s panicked in Setup(): %v\nStack: %s",
72 s.underlying.Name(), r, debug.Stack())
73 err = fmt.Errorf("trigger %s panicked in Setup(): %v",
74 s.underlying.Name(), r)
75 }
76 }()
77 return s.underlying.Setup(ctx)
78}
79
80func (s *PanicableTrigger) HandleWebhook(ctx core.WebhookRequestContext) (status int, response *core.WebhookResponseBody, err error) {
81 defer func() {

Calls 3

ErrorfMethod · 0.80
NameMethod · 0.65
SetupMethod · 0.65

Tested by 1