mirror of
https://github.com/Sarsoo/Spotify.NET.git
synced 2024-12-24 23:16:28 +00:00
Error Handling
This commit is contained in:
parent
1c5f6899eb
commit
c1dc2313cb
@ -12,12 +12,19 @@ namespace SpotifyAPI.Local.Models
|
|||||||
public string Type { get; internal set; }
|
public string Type { get; internal set; }
|
||||||
public string Id { get; internal set; }
|
public string Id { get; internal set; }
|
||||||
|
|
||||||
public SpotifyUri(string Uri)
|
public SpotifyUri(string uri)
|
||||||
{
|
{
|
||||||
string[] props = Uri.Split(':');
|
if (String.IsNullOrEmpty(uri))
|
||||||
this.Base = props[0];
|
throw new ArgumentNullException("Uri");
|
||||||
this.Type = props[1];
|
|
||||||
this.Id = props[2];
|
string[] props = uri.Split(':');
|
||||||
|
|
||||||
|
if (props.Length != 3)
|
||||||
|
throw new ArgumentException("Unexpected Uri");
|
||||||
|
|
||||||
|
Base = props[0];
|
||||||
|
Type = props[1];
|
||||||
|
Id = props[2];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user