Skip to content
This repository has been archived by the owner on Feb 23, 2020. It is now read-only.

Better error message for 404s #39

Open
radar opened this issue May 5, 2014 · 0 comments
Open

Better error message for 404s #39

radar opened this issue May 5, 2014 · 0 comments

Comments

@radar
Copy link
Contributor

radar commented May 5, 2014

(I am not sure if this should go here on the hub itself, but whatever)

I'm attempting to connect to the Hub and I'm getting back a 404:

D, [2014-05-05T15:37:11.208364 #10133] DEBUG -- : [httplog] Connecting: push.hubapp.io:443
D, [2014-05-05T15:37:12.084110 #10133] DEBUG -- : [httplog] Sending: POST http://push.hubapp.io:443/
D, [2014-05-05T15:37:12.084217 #10133] DEBUG -- : [httplog] Header: content-type: application/json
D, [2014-05-05T15:37:12.084273 #10133] DEBUG -- : [httplog] Header: x-hub-store: 536707c269702d79b9f90000
D, [2014-05-05T15:37:12.084337 #10133] DEBUG -- : [httplog] Header: x-hub-access-token: b93f6e969355a2a1e18c8528316b51626de78193182154b9
D, [2014-05-05T15:37:12.084399 #10133] DEBUG -- : [httplog] Header: x-hub-timestamp: 1399268231
D, [2014-05-05T15:37:12.084459 #10133] DEBUG -- : [httplog] Header: connection: close
D, [2014-05-05T15:37:12.084550 #10133] DEBUG -- : [httplog] Data: {"products":[{"id":34,"parent_id":null,"name":"Blah","sku":"","description":null,"price":19.0,"cost_price":0.0,"available_on":null,"permalink":"blah-1","meta_description":null,"meta_keywords":null,"shipping_category":"Default","taxons":[],"options":{},"images":[]}]}
D, [2014-05-05T15:37:12.399500 #10133] DEBUG -- : [httplog] Status: 404
D, [2014-05-05T15:37:12.399594 #10133] DEBUG -- : [httplog] Benchmark: 0.314858 seconds
D, [2014-05-05T15:37:12.399666 #10133] DEBUG -- : [httplog] Header: server: nginx/1.1.19
D, [2014-05-05T15:37:12.399719 #10133] DEBUG -- : [httplog] Header: x-rack-cache: invalidate, pass
D, [2014-05-05T15:37:12.399769 #10133] DEBUG -- : [httplog] Header: content-type: text/html; charset=utf-8
D, [2014-05-05T15:37:12.399821 #10133] DEBUG -- : [httplog] Header: date: Mon, 05 May 2014 05:37:12 GMT
D, [2014-05-05T15:37:12.399879 #10133] DEBUG -- : [httplog] Header: status: 404 Not Found
D, [2014-05-05T15:37:12.399923 #10133] DEBUG -- : [httplog] Header: x-request-id: d04777935ba6ab10e329a9b43ba26eea
D, [2014-05-05T15:37:12.399973 #10133] DEBUG -- : [httplog] Header: x-runtime: 0.016861
D, [2014-05-05T15:37:12.400028 #10133] DEBUG -- : [httplog] Header: connection: close
D, [2014-05-05T15:37:12.400081 #10133] DEBUG -- : [httplog] Header: content-length: 728
D, [2014-05-05T15:37:12.400149 #10133] DEBUG -- : [httplog] Response:
<!DOCTYPE html>
<html>
<head>
  <title>The page you were looking for doesn't exist (404)</title>
  <style type="text/css">
    body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
    div.dialog {
      width: 25em;
      padding: 0 4em;
      margin: 4em auto 0 auto;
      border: 1px solid #ccc;
      border-right-color: #999;
      border-bottom-color: #999;
    }
    h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
  </style>
</head>

<body>
  <!-- This file lives in public/404.html -->
  <div class="dialog">
    <h1>The page you were looking for doesn't exist.</h1>
    <p>You may have mistyped the address or the page may have moved.</p>
  </div>
</body>
</html>

I can only see this information because I've installed the httplog gem and have set HttpLog.options[:log_headers] = true in config/initializers/spree.rb. If I didn't have those two things, spree_hub just fails silently. I would rather it didn't :)

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

No branches or pull requests

1 participant