openfaas / openfaas/go-sdk

Change from returning error to HttpError

Open
#4 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
4
Forks
5
PR merge metrics
No merged PRs in 30d

Description

Change from returning error to HttpError to allow the end-user to read the Status code from the server, along with the error message we already return.

type HttpError struct {
	Err    error
	Status int
}

func (e *HttpError) Error() string {
	return e.Err.Error()
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file, test, or entry point is named in the issue. Start by locating the SDK methods that currently return error and trace how server status codes are handled; confirm the intended public error shape before changing the API. Done means callers can read the HTTP status code while the existing error message remains available.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.