Skip to content

Commit

Permalink
removed os.Exit on AMI error
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeljkoBenovic committed Oct 12, 2023
1 parent 682ca52 commit 325d8ee
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions internal/adapters/core/core.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package core

import (
"os"

"github.com/ZeljkoBenovic/ast-ami-go/internal/ports"
"github.com/ZeljkoBenovic/ast-ami-go/internal/types"
"github.com/hashicorp/go-hclog"
Expand Down Expand Up @@ -49,8 +47,7 @@ func (a *Adapter) ConnectToAsterisk() {

a.ami.Connect()
a.ami.On("error", func(message string) {
a.logger.Error("Could not connect to Asterisk AMI", "err", message, "config", a.config)
os.Exit(1)
a.logger.Error("Error received from the Asterisk AMI", "err", message)
})
a.ami.On("connect", func(message string) {
a.logger.Info("Connected to Asterisk AMI",
Expand Down

0 comments on commit 325d8ee

Please sign in to comment.