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

Server-side 500 should occur if a route does not return a value it matched #7

Closed
jhusain opened this issue May 6, 2015 · 4 comments
Assignees
Labels

Comments

@jhusain
Copy link
Contributor

jhusain commented May 6, 2015

We should return a 500 here to avoid retrying endless numbers of times for a request that will never be satisfied.

Note that this error only occurs when a route is matched but the route returns no data.

We should also log to the console exactly which were expected to be found, but not found.

@ThePrimeagen
Copy link
Contributor

This needs to be better explained as there are many edge cases and the router itself does not 500, it can only onNext & onCompleted | onError.

@jhusain
Copy link
Contributor Author

jhusain commented May 20, 2015

The router returns an Observable for all of its requests: call, get, and set. All you have to do is make sure it onErrors. It is the servers responsibility to return a 500

JH

On May 20, 2015, at 8:20 AM, Michael Paulson notifications@github.com wrote:

This needs to be better explained as there are many edge cases and the router itself does not 500, it can only onNext & onCompleted | onError.


Reply to this email directly or view it on GitHub.

@ThePrimeagen
Copy link
Contributor

That seems a little harsh. Maybe we should consider something different as imagine the following.

router.get([['videos', [123, 456, 678], 'title']])

// This returns
{
    jsong: {
        videos: {
            123: { title: 'HoC' },
            456: { title: 'OITNB' }
        }
    }
}

// Should we really throw?

@ThePrimeagen
Copy link
Contributor

This is a bad idea.

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