Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors aren't being wrapped #467

Closed
steveklabnik opened this issue Jan 6, 2014 · 4 comments
Closed

Errors aren't being wrapped #467

steveklabnik opened this issue Jan 6, 2014 · 4 comments
Labels

Comments

@steveklabnik
Copy link
Contributor

related: #455

When you try to refund an unstored card, you don't get a wrapped error:

  Scenario: Crediting a deleted card leads to failure                                                                                                              
    Given I have tokenized a card                                                                                                                                  
    When I make a DELETE request to the href "href"                                                                                                                
    Then I should get a 204 status code                                                                                                                            

    When I make a POST request to /cards/:cards_id/credits                                                                                                         
    Then I should get a 404 status code                                                                                                                            

    And the response is valid according to the "errors" schema                                                                                                     
    And the fields on this error match:                                                                                                                            
    """                                                                                                                                                            
      {                                                                                                                                                            
       "category_code": "not-found"                                                                                                                                
      }                                                                                                                                                            
    """       
{"status"=>"Not Found", "category_code"=>"not-found", "category_type"=>"request", "description"=>"<p>The requested URL was not found on the server.</p><p>If you en
tered the URL manually please check your spelling and try again.</p> Your request id is OHMa4fd1810771f11e3bae9026ba7f8ec28.", "request_id"=>"OHMa4fd1810771f11e3ba
e9026ba7f8ec28", "status_code"=>404}

This should be wrapped in an error object.

steveklabnik added a commit that referenced this issue Jan 6, 2014
@mjallday
Copy link
Contributor

@steveklabnik are you passing revision 1.1 headers? by default everything is revision 1.0 so it won't be wrapped... if you are passing those headers please reopen and we'll investigate.

@steveklabnik
Copy link
Contributor Author

@steveklabnik steveklabnik reopened this Jan 14, 2014
@mjallday
Copy link
Contributor

@steveklabnik is this still happening?

curl https://api.balancedpayments.com/fourohfour -H "Accept: application/vnd.api+json;revision=1.1"

{
  "errors": [
    {
      "status": "Not Found",
      "category_code": "not-found",
      "description": "<p>The requested URL was not found on the server.</p><p>If you entered the URL manually please check your spelling and try again.</p> Your request id is OHM6af85fd8820c11e38fce026ba7f8ec28.",
      "status_code": 404,
      "category_type": "request",
      "request_id": "OHM6af85fd8820c11e38fce026ba7f8ec28"
    }
  ]
}

@steveklabnik
Copy link
Contributor Author

Looks like we're good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants