How to custom keyword show failed step

I have create a custom keyword like:

	def VerifyClientEnable(String clientName){
		KeywordUtil key = new KeywordUtil()
		CustomLog log = new CustomLog()
			Statement stm = connection.createStatement()
			String query = "SELECT Top (1) * FROM Account a INNER JOIN PhotoStudioClient p ON a.AccountId = p.ClientId WHERE a.AccountName ='"+clientName+"'"
			ResultSet rs = stm.executeQuery(query)
					Object value = rs.getObject("IsEnabled")
					System.out.println("===== LOG =====")
					System.out.println("Value: " + value.toString())
						KeywordUtil.markPassed("VerifyClientEnable PASSED 1")
						System.out.println("VerifyClientEnable PASSED 2")
						logger.logPassed("VerifyClientEnable PASSED 3")
						KeywordUtil.markFailed("VerifyClientEnable FAILED 1")
						System.out.println("VerifyClientEnable FAILED 2")
						log.markStepFailed("VerifyClientEnable FAILED 3")
						logger.logFailed("VerifyClientEnable FAILED 4")
			}catch(Exception e){
			System.out.println("VerifyClientEnable QUERY FAILED 1" + e)
			KeywordUtil.markFailed("VerifyClientEnable FAILED 2")
			log.markStepFailed("VerifyClientEnable FAILED 3")
			logger.logFailed("VerifyClientEnable FAILED 4")
	return false


But it can not show fail step when execute query fail, or value = false
Please help!!!

What’s the output in case of failure?

Show error step, red line in log, and show message log

KeywordUtil.markFailed(“VerifyClientEnable FAILED 1”)
System.out.println(“VerifyClientEnable FAILED 2”)
log.markStepFailed(“VerifyClientEnable FAILED 3”)
logger.logFailed(“VerifyClientEnable FAILED 4”)

Oh, I meant actual output. Sorry for confusion.

by enclosing all other check’s in this loop, there may be a chance they are never executed if rs is empty
so … as @marek said … how do you simulate the failure and what is the actual output log?

sorry, if some things I do not understand.
I need query to database to get a column value.
=> if value = true mean test case is passed
=> otherwise if value = false test case is failed
when test case is failed I want to show error, failed step by “KeywordUtil.markFailed(errMes)”
but with my code below, it still show step is passed.
I don’t know why ?
please help me.