@@ -485,7 +485,7 @@ public Task<ContentstackResponse> LogoutAsync(string authtoken = null)
485485 public OAuthHandler OAuth ( OAuthOptions options )
486486 {
487487 if ( options == null )
488- throw new ArgumentNullException ( nameof ( options ) , "OAuth options cannot be null." ) ;
488+ throw new ArgumentNullException ( nameof ( options ) , CSConstants . OAuthOptionsRequired ) ;
489489
490490 return new OAuthHandler ( this , options ) ;
491491 }
@@ -519,10 +519,10 @@ public OAuthHandler OAuth()
519519 internal void SetOAuthTokens ( OAuthTokens tokens )
520520 {
521521 if ( tokens == null )
522- throw new ArgumentNullException ( nameof ( tokens ) , "OAuth tokens cannot be null." ) ;
522+ throw new ArgumentNullException ( nameof ( tokens ) , CSConstants . OAuthTokensRequired ) ;
523523
524524 if ( string . IsNullOrEmpty ( tokens . AccessToken ) )
525- throw new ArgumentException ( "Access token cannot be null or empty." , nameof ( tokens ) ) ;
525+ throw new ArgumentException ( CSConstants . AccessTokenRequired , nameof ( tokens ) ) ;
526526
527527 // Store the access token in the client options for use in HTTP requests
528528 // This will be used by the HTTP pipeline to inject the Bearer token
@@ -541,7 +541,7 @@ internal void SetOAuthTokens(OAuthTokens tokens)
541541 public OAuthTokens GetOAuthTokens ( string clientId )
542542 {
543543 if ( string . IsNullOrEmpty ( clientId ) )
544- throw new ArgumentException ( "Client ID cannot be null or empty." , nameof ( clientId ) ) ;
544+ throw new ArgumentException ( CSConstants . ClientIDRequired , nameof ( clientId ) ) ;
545545
546546 return GetStoredOAuthTokens ( clientId ) ;
547547 }
@@ -607,7 +607,7 @@ public void ClearOAuthTokens(string clientId = null)
607607 internal void StoreOAuthTokens ( string clientId , OAuthTokens tokens )
608608 {
609609 if ( string . IsNullOrEmpty ( clientId ) )
610- throw new ArgumentException ( "Client ID cannot be null or empty." , nameof ( clientId ) ) ;
610+ throw new ArgumentException ( CSConstants . ClientIDRequired , nameof ( clientId ) ) ;
611611
612612 if ( tokens == null )
613613 throw new ArgumentNullException ( nameof ( tokens ) ) ;
0 commit comments