Skip to content

Commit

Permalink
better git commit error message if appurl == null
Browse files Browse the repository at this point in the history
  • Loading branch information
aeberhart committed Apr 12, 2024
1 parent 16e84d0 commit b32aff7
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ public class GitCommit extends AbstractVarArgFunction<Void> {
public Void run(List args) throws Exception {
if (!sc.isUserInRole("admin"))
throw new Exception("must be admin to perform Git operations");
URL url = new URL(ConfigProvider.getConfig().getConfigValue("dashjoin.appurl").getValue());
String spec = ConfigProvider.getConfig().getConfigValue("dashjoin.appurl").getValue();
if (spec == null)
throw new Exception("Cannot commit: No repository configured.");
URL url = new URL(spec);
String user = url.getUserInfo();
if (user == null)
throw new IllegalArgumentException("No Git credentials configured in the App URL");
Expand Down

0 comments on commit b32aff7

Please sign in to comment.