Skip to content

Commit 051440c

Browse files
authored
fix: the DELETE /session API should not throw error if session entry … (#13063)
fix: the DELETE /session API should not throw error if session entry is not found (Admin UI) Signed-off-by: duttarnab <arnab.bdutta@gmail.com>
1 parent ed81f84 commit 051440c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

jans-config-api/plugins/admin-ui-plugin/src/main/java/io/jans/ca/plugin/adminui/service/adminui/AdminUISessionService.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import io.jans.configapi.core.service.ConfigHttpService;
1717
import io.jans.model.net.HttpServiceResponse;
1818
import io.jans.orm.PersistenceEntryManager;
19+
import io.jans.orm.exception.EntryPersistenceException;
1920
import io.jans.orm.search.filter.Filter;
2021
import io.jans.service.EncryptionService;
2122
import io.jans.util.security.StringEncrypter;
@@ -81,8 +82,12 @@ public AdminUISession getSession(String sessionId) {
8182
try {
8283
configApiSession = persistenceEntryManager
8384
.find(AdminUISession.class, getDnForSession(sessionId));
85+
} catch (EntryPersistenceException e) {
86+
//do not throw error if the record is not present in database
87+
return configApiSession;
8488
} catch (Exception ex) {
8589
logger.error(SID_ERROR + "{}", sessionId, ex);
90+
throw ex;
8691
}
8792
return configApiSession;
8893
}

0 commit comments

Comments
 (0)