Skip to content

Commit

Permalink
Fix reportAccessDenied mistake set error code
Browse files Browse the repository at this point in the history
Signed-off-by: HangyuanLiu <[email protected]>
  • Loading branch information
HangyuanLiu committed Aug 23, 2023
1 parent ecbf5f7 commit e9127bc
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
package com.starrocks.privilege;

import com.starrocks.common.ErrorCode;
import com.starrocks.common.ErrorReport;

public class AccessDeniedException extends RuntimeException {
public AccessDeniedException(String message) {
super(message);
}

public static void reportAccessDenied(String privilegeMessage, ObjectType objectType, String object) {
throw new AccessDeniedException(ErrorReport.reportCommon(null,
ErrorCode.ERR_ACCESS_DENIED, privilegeMessage, objectType.name(), object == null ? "" : " " + object));
String errMsg = ErrorCode.ERR_ACCESS_DENIED.formatErrorMsg(
privilegeMessage, objectType.name(), object == null ? "" : " " + object);
throw new AccessDeniedException(errMsg);
}
}

0 comments on commit e9127bc

Please sign in to comment.