Comments (5)
Hi @ncipollina - thanks for raising your comment.
Because exception handling is an area where everyone has different opinions - the extension doesn't try and hide or wrap any exceptions. If you receive a 403 your skill code should be able to catch that WebException and deal with it accordingly.
There are error handlers within https://github.com/stoiveyp/Alexa.NET.RequestHandlers which can help isolate and maintain error logic, but if you have suggestions on a better way of handling that it'd be great to have a discussion on those.
from alexa.net.profile.
The problem is that HttpClient doesn't throw a WebException, it throws HttpRequestException, which does not include the status code.
from alexa.net.profile.
Ahh okay. If it's not part of the underlying exception given to us from .NET - I'm not sure I understand how we could return it consistently?
from alexa.net.profile.
I would handle it by calling the EnsureSuccessStatusCode method, and if the status is an error, return a custom exception with the status code. The consumer of the API could use that to know that it failed due to a permissions or other issue.
from alexa.net.profile.
At this point we're implementing a custom exception structure as well as altering the way we deal with the requests at an HttpClient level.
I'm happy to keep it as a future feature but short term I'd recommend using the custom client implementation (link below). Thanks for the information though.
from alexa.net.profile.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alexa.net.profile.