Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
package com.vk.api.sdk.exceptions;

public class ApiAuthValidationException extends ApiException {
public ApiAuthValidationException(String message) {

private final String redirectUri;

public ApiAuthValidationException(String message, String redirectUri) {
super(17, "Validation required", message);
this.redirectUri = redirectUri;
}

public String getRedirectUri() {
return redirectUri;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static ApiException parseException(Error error) {
case 16:
return new ApiAuthHttpsException(error.getErrorMsg());
case 17:
return new ApiAuthValidationException(error.getErrorMsg());
return new ApiAuthValidationException(error.getErrorMsg(), error.getRedirectUri());
case 18:
return new ApiUserDeletedException(error.getErrorMsg());
case 19:
Expand Down
17 changes: 15 additions & 2 deletions sdk/src/main/java/com/vk/api/sdk/objects/base/Error.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ public class Error implements Validable {
@SerializedName("request_params")
private List<RequestParam> requestParams;

@SerializedName("redirect_uri")
private String redirectUri;

public Integer getErrorCode() {
return errorCode;
}
Expand Down Expand Up @@ -82,9 +85,17 @@ public Error setRequestParams(List<RequestParam> requestParams) {
return this;
}

public String getRedirectUri() {
return redirectUri;
}

public void setRedirectUri(String redirectUri) {
this.redirectUri = redirectUri;
}

@Override
public int hashCode() {
return Objects.hash(errorText, errorSubcode, requestParams, errorCode, errorMsg);
return Objects.hash(errorText, errorSubcode, requestParams, errorCode, errorMsg, redirectUri);
}

@Override
Expand All @@ -96,7 +107,8 @@ public boolean equals(Object o) {
Objects.equals(errorMsg, error.errorMsg) &&
Objects.equals(requestParams, error.requestParams) &&
Objects.equals(errorCode, error.errorCode) &&
Objects.equals(errorSubcode, error.errorSubcode);
Objects.equals(errorSubcode, error.errorSubcode) &&
Objects.equals(redirectUri, error.redirectUri);
}

@Override
Expand All @@ -112,6 +124,7 @@ public String toPrettyString() {
sb.append(", requestParams=").append(requestParams);
sb.append(", errorCode=").append(errorCode);
sb.append(", errorSubcode=").append(errorSubcode);
sb.append(", redirectUri=").append(redirectUri);
sb.append('}');
return sb.toString();
}
Expand Down