"use strict";(self.webpackChunkspotify_api_docs=self.webpackChunkspotify_api_docs||[]).push([[6112],{3905:function(e,t,n){n.d(t,{Zo:function(){returnl},kt:function(){returnf}});varr=n(7294);functiono(e,t,n){returntine?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}functiona(e,t){varn=Object.keys(e);if(Object.getOwnPropertySymbols){varr=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){returnObject.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}returnn}functioni(e){for(vart=1;t<arguments.length;t++){varn=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}returne}functions(e,t){if(null==e)return{};varn,r,o=function(e,t){if(null==e)return{};varn,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);returno}(e,t);if(Object.getOwnPropertySymbols){vara=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}returno}varc=r.createContext({}),p=function(e){vart=r.useContext(c),n=t;returne&&(n="function"==typeofe?e(t):i(i({},t),e)),n},l=function(e){vart=p(e.components);returnr.createElement(c.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){vart=e.children;returnr.createElement(r.Fragment,{},t)}},d=r.forwardRef((function(e,t){varn=e.components,o=e.mdxType,a=e.originalType,c=e.parentName,l=s(e,["components","mdxType","originalType","parentName"]),d=p(n),f=o,m=d["".concat(c,".").concat(f)]||d[f]||u[f]||a;returnn?r.createElement(m,i(i({ref:t},l),{},{components:n})):r.createElement(m,i({ref:t},l))}));functionf(e,t){varn=arguments,o=t&&t.mdxType;if("string"==typeofe||o){vara=n.length,i=newArray(a);i[0]=d;vars={};for(varcint)hasOwnProperty.call(t,c)&&(s[c]=t[c]);s.originalType=e,s.mdxType="string"==typeofe?e:o,i[1]=s;for(varp=2;p<a;p++)i[p]=n[p];returnr.createElement.apply(null,i)}returnr.createElement.apply(null,n)}d.displayName="MDXCreateElement"},5313:function(e,t,n){n.r(t),n.d(t,{frontMatter:function(){returni},contentTitle:function(){returns},metadata:function(){returnc},toc:function(){returnp},default:function(){returnu}});varr=n(3117),o=n(102),a=(n(7294),n(3905)),i={id:"error_handling",title:"Error Handling"},s=void0,c={unversionedId:"error_handling",id:"error_handling",isDocsHomePage:!1,title:"Error Handling",description:"API calls can fail when input data is malformed or the server detects issues with the request. As an example, the following request obviously fails:",source:"@site/docs/error_handling.md",sourceDirName:".",slug:"/error_handling",permalink:"/SpotifyAPI-NET/docs/error_handling",editUrl:"https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/docs/error_handling.md",version:"current",lastUpdatedBy:"dependabot[bot]",lastUpdatedAt:1632860011,formattedLastUpdatedAt:"9/28/2021",frontMatter:{id:"error_handling",title:"Error Handling"},sidebar:"docs",previous:{title:"Getting Started",permalink:"/SpotifyAPI-NET/docs/getting_started"},next:{title:"Configuration",permalink:"/SpotifyAPI-NET/docs/configuration"}},p=[{value:"APIException",id:"apiexception",children:[]},{value:"APIUnauthorizedException",id:"apiunauthorizedexception",children:[]},{value:"APITooManyRequestsException",id:"apitoomanyrequestsexception",children:[]}],l={toc:p};functionu(e){vart=e.components,n=(0,o.Z)(e,["components"]);return(0,a.kt)("wrapper",(0,r.Z)({},l,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"API calls can fail when input data is malformed or the server detects issues with the request. As an example, the following request obviously fails:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-csharp"},'var track = await spotify.Tracks.Get("NotExistingTrackId");\nConsole.WriteLine(track.Name);\n')),(0,a.kt)