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

FunctionHandler fails to handle unexpected routes #3

Open
Ubiguchi opened this issue Feb 29, 2024 · 0 comments
Open

FunctionHandler fails to handle unexpected routes #3

Ubiguchi opened this issue Feb 29, 2024 · 0 comments

Comments

@Ubiguchi
Copy link

StockTraderAPI.Program.FunctionHandler handles /price/ and /history/, but doesn't have a default switch case for handling unexpected routes, resulting in it returning a null.

Might it make sense to add a catch-all for any other routes and then return a well-formatted API response, along these lines:

       default:
            response = await _getStockEndpoints.GetInvalidRoute(request.PathParameters["stockSymbol"]);
            break;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant