question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Run_plugin endpoint in the Rest API should return a valid error when an incorrect graph_id is supplied

See original GitHub issue

Prerequisites

Description

If you specify an invalid value for graph_id - The id of a graph to run the plugin on (optional) it doesn’t run the plugin, but returns 200, as if it was successful. Instead it should return error 422. (The valid graph_id could be retrieved from the get_graph endpoint.)

image

Steps to Reproduce

  1. Load the Rest API (Tools-Start REST Server)
  2. Try out POST - run_plugin with an invalid text for graph_id

Expected behaviour: Return error 422.

Actual behaviour: Returns 200, as if it was successful.

Reproduces how often: 100%

Additional Information

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

1reaction
Auriga2commented, Jun 15, 2020

I managed to get it to work by passing the HttpServletResponse response object to the services classes. But tricky to refactor the FileListener.java class.

image

0reactions
arcturus2commented, Jun 17, 2020

No worries thank you @Auriga2. FileListener is involved to get working and OK to skip at this point.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Should a RESTful API return 400 or 404 when passed an ...
I would return 404 in case of resource does not exist(means the url path is wrong) and i will return 400 only if...
Read more >
Best Practices for REST API Error Handling - Baeldung
The simplest way we handle errors is to respond with an appropriate status code. Here are some common response codes: 400 Bad Request...
Read more >
Common REST API error codes - Azure Storage
Error code HTTP status code User message AccountAlreadyExists Conflict (409) The specified account already exists. AccountIsDisabled Forbidden (403) The specified account is disabled. AccountProtectedFromDeletion Conflict (409)...
Read more >
HTTP Status Codes in the REST API | UniProt help
This document explains the HTTP response headers returned by the UniProt REST API and gives some examples to make explicit what they mean....
Read more >
REST API Developer Guide
You can use REST API tools to create, manipulate, and search data in Salesforce by sending HTTP requests to endpoints in Salesforce.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found