appdotnet / api-spec

App.net API Documentation is on the web at https://developers.app.net. Source for these docs is in the new-docs branch here. Please use the issue tracker and submit pull requests! Help us build the real-time social service where users and developers come first, not advertisers.
https://developers.app.net
950 stars 98 forks source link

HTML error shown when there are duplicate link entities #238

Closed mattflaschen closed 12 years ago

mattflaschen commented 12 years ago

If there are duplicate link entities like:

{
    "name": "Matthew Flaschen",
    "locale": "da_DK",
    "timezone": "America/New_York",
    "description": {
        "text": "I'm a software engineer living in Philadelphia.  I went to Georgia Tech.  My previous position was at Entech Consulting.\r\n\r\nI'm developing App Passant ( http://www.apppassant.com/ ), a chess web app for app.net.  Follow @apppassant for the latest.",
        "entities": {
            "links": [
                {
                    "pos": 203,
                    "len": 7,
                    "url": "http://app.net"
                },
                {
                    "pos": 153,
                    "len": 26,
                    "url": "http://www.apppassant.com/"
                },
                {
                    "pos": 203,
                    "len": 7,
                    "url": "http://app.net"
                }
            ]
        }
    }
}

it fails with a long HTML error response. An excerpt is:

        <div class="container">
            <span>
                <strong>500</strong>
                <hr>
                <p>Sorry, an error has occurred. Please try again.</p>
                <p>If this error persists, <a href="http://app.net/contact">please let us know</a>.</p>
            <span>
        </div>

It should use a JSON error message like the others (code, error_id, error_message). I tracked this down in my code, but the non-specific HTML error made it more confusing.

mthurman commented 12 years ago

Sorry about that, this should be fixed now.