openlang

Email alerts for exceptions and errors in an application

I want an email sent whenever my application encounters an error.

exception plus the .go filename and its line number.

that would really help us

The conversation continues 2

Follow the reasoning
  1. Permalink

    Hi, this isn't something I'd advise. Why aren't you using ordinary logging? If locating the line takes you ages and that is the difficulty, I've run into that too.

    Here's my http error response code, though a similar approach lets you immediately locate whatever caused the failure.

    type FailureReply struct {
        Detail string `json:"detail"` // My own explanaton of why this happened.
        Error string `json:"error"`
    }
    
        permissions, lookupErr := service.Queries.GetPurePermissionsByUserId(context.Background(), member.ID)
        if lookupErr != nil {
            helpers.RespondWithJSON(writer, helpers.FailureReply{
                Detail: "Could not retrieve member permissions",
                Error: lookupErr.Error(),
            })
            return
        }

Other sides of the same question

  1. Detecting a missing input file

    Hello, I've run into a difficulty with a script of mine. Searching the web hasn't turned up a solution. A folder receives a p…

    Replies 2Latest activity powershell
  2. F# negation when testing file existence

    I'm using this code to signal an error if a file is missing. Instead, this error appears. What did I misunderstand?

    Replies 2Latest activity fsharp
  3. Can main() supply an exit status without disrupting control flow?

    Must an exit status always be supplied through os.exit()? Calling os.exit() inside main() prevents me from using defer, produ…

    Replies 3Latest activity odin