Skip to content

Commit

Permalink
updated the error message (#125) (#127)
Browse files Browse the repository at this point in the history
* updated the error message (#125)

* Update messages.properties
  • Loading branch information
vishalhcl-5960 authored Nov 24, 2023
1 parent e5ccbf2 commit 0d03009
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/hcl/appscan/sdk/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ error.dom.state=Bad DOM state.
error.http=Response Code: {0}\nReason: {1}
error.login.type.deprectated=The specified login type is deprecated. Please use API key and secret.
error.getting.info=An error occurred getting information for {0} with id {1}.
error.url.validation = An error occurred while validating the URL.
error.url.validation = An error occurred while validating the Starting URL: {0}.

#Presence
error.getting.presence.details=An error occurred retrieving details for Presence with id {0}.
Expand All @@ -70,4 +70,4 @@ error.update.job=An error occurred updating the job. {0}
message.running.job=Executing job...
message.executed.job=Job executed successfully.
error.execute.job=An error occurred executing the job. {0}
error.invalid.details=The job details contain missing or invalid parameters.
error.invalid.details=The job details contain missing or invalid parameters.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public String createAndExecuteScan(String type, Map<String, String> params) {
return json.getString(ID);
} else if (json != null && json.has(MESSAGE)) {
String errorResponse = json.getString(MESSAGE);
if(json.has(FORMAT_PARAMS)) {
if(json.has(FORMAT_PARAMS) && !json.isNull(FORMAT_PARAMS)) {
JSONArray jsonArray = json.getJSONArray(FORMAT_PARAMS);
if(jsonArray != null){
String[] messageParams = new String[jsonArray.size()];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ public void run() throws ScannerException, InvalidTargetException {
Map<String, String> params = getProperties();
params.put(STARTING_URL, target);

IAuthenticationProvider authProvider = getServiceProvider().getAuthenticationProvider();
if(params.get(PRESENCE_ID).isEmpty() && !ServiceUtil.isValidUrl(params.get(STARTING_URL), authProvider, authProvider.getProxy())) {
throw new ScannerException(Messages.getMessage(CoreConstants.ERROR_URL_VALIDATION));
IAuthenticationProvider authProvider = getServiceProvider().getAuthenticationProvider();
if(params.get(PRESENCE_ID).isEmpty() && !ServiceUtil.isValidUrl(target, authProvider, authProvider.getProxy())) {
throw new ScannerException(Messages.getMessage(CoreConstants.ERROR_URL_VALIDATION, target));
}

String scanLoginType = null;
Expand Down

0 comments on commit 0d03009

Please sign in to comment.