Skip to content

HTTP Errors are not properly handled (v 1.3.0 and 1.4.0)Β #25

@nicolaslaunaySO

Description

@nicolaslaunaySO

With SDK version 1.3.0 and 1.4.0, HTTP errors like the 404 error are not properly returned, and give an SDK error instead.

Steps to reproduce

package main

import (
	"context"
	"log"
	"os"

	novugo "github.com/novuhq/novu-go"
)

func main() {
	apiKey := os.Getenv("NOVU_API_KEY")
	client := novugo.New(novugo.WithSecurity(apiKey))

	_, err := client.Workflows.Get(context.Background(), "non-existent-workflow", nil, nil)
	if err != nil {
		log.Fatal(err)
	}
}

Expected :

"404 error" or equivalent

Actual :

error reading response body: file already closed``

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions