Skip to content

Throw helpful error message when field option cannot be matched #43

@gr2m

Description

@gr2m

Please avoid duplicates

Reproducible test case

No response

Please select the environment(s) that are relevant to your bug report

  • Browsers
  • Node
  • Deno

Versions

2.0.0

What happened?

import Project from "github-project";

const project = new Project({
  token: process.env.GITHUB_TOKEN,
  org: "github",
  number: 5427,
  fields: {
    status: "Status",
  },
});

project.items.updateByContentRepositoryAndNumber(
  repo,
  1,
  {
    status: "some unknown value",
  }
);

// throws:
//     GraphqlResponseError: Request failed due to following response errors:
//      - Column value must be a valid value for single_select column

The error should be more helpful than that. The message should include the value, the field name (both project field name and user-defined name), and all valid values

Would you be interested in contributing a fix?

  • yes

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingreleased

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions