feat:[AH-1011]: Changes for HAR license check (#3520)

* feat:[AH-1011]: fix checks
* feat:[AH-1011]: Changes for HAR license check
try-new-ui
Sourabh Awashti 2025-03-10 10:36:50 +00:00 committed by Harness
parent 0f1e5cda15
commit 660738e8ab
2 changed files with 8 additions and 0 deletions

View File

@ -87,6 +87,12 @@ func Translate(ctx context.Context, err error) *Error {
case errors.As(err, &maxBytesErr):
return RequestTooLargef("The request is too large. maximum allowed size is %d bytes", maxBytesErr.Limit)
case errors.Is(err, store.ErrLicenseExpired):
return BadRequestf("license expired.")
case errors.Is(err, store.ErrLicenseNotFound):
return BadRequestf("license not found.")
// git errors
case errors.As(err, &appError):
if appError.Err != nil {

View File

@ -32,4 +32,6 @@ var (
ErrSpaceWithChildsCantBeDeleted = errors.New("the space can't be deleted as it still contains " +
"spaces or repos")
ErrPreConditionFailed = errors.New("precondition failed")
ErrLicenseNotFound = errors.New("license not found")
ErrLicenseExpired = errors.New("license expired")
)