Skip to content

Commit

Permalink
improve exception messages
Browse files Browse the repository at this point in the history
  • Loading branch information
kwin committed Jul 20, 2022
1 parent 357ddce commit 521a09a
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public boolean get( URIish uri, CredentialItem... items ) throws UnsupportedCred
}
catch ( PrompterException e )
{
throw new IllegalStateException( "Can not prompt user " + e.getMessage() , e );
throw new IllegalStateException( "Cannot prompt user " + e.getMessage() , e );
}
}
return true;
Expand All @@ -73,7 +73,7 @@ private void get( URIish uri, CredentialItem item ) throws PrompterException
if ( !interactive )
{
throw new UnsupportedCredentialItem( uri,
"Cannot provide " + item.getClass() + " in non-interactive mode" );
"Cannot provide '" + item.getClass() + "' in non-interactive mode" );
}
if ( item instanceof CredentialItem.YesNoType )
{
Expand Down Expand Up @@ -107,7 +107,8 @@ else if ( item instanceof CredentialItem.CharArrayType )
}
else
{
throw new UnsupportedCredentialItem( uri, item.getClass().toString() );
throw new UnsupportedCredentialItem( uri, "This provider does not support items of type '"
+ item.getClass().toString() + "'" );
}
}
}
Expand Down

0 comments on commit 521a09a

Please sign in to comment.