Couchbase java sdk wrong n1ql sql doesnt trigger onError

Hi team ,

I am calling the N1QL queries in the following way .
if the final sql has a wrong syntax it does not fire the on error method in the subscriber intead query completes with no results . How do i handle this situation

bucket.async().query(N1qlQuery.simple(FinalSql))
.retryWhen(RetryBuilder.anyOf(BackpressureException.class)
.delay(Delay.exponential(TimeUnit.MILLISECONDS, 5000)).max(5).build())
.flatMap(AsyncN1qlQueryResult::rows).map(row -> {
return row.value().toString();
}).timeout(10, TimeUnit.SECONDS).subscribe(new Subscriber() {

				JsonArray jarray = new JsonArray();

				public void onCompleted() {
					// Extra logger for debug

					
					if (jarray.size() > 0) {
						LOGGER.config("Decrypting :");
						try {
							jarray = decryptsetDatatype(jarray, enableDataTypeConversion);
						} catch (Exception e) {

							LOGGER.info("Error Executing the request " + e.toString());
							MyLogHandler.setEndCrypto();
							Response = QueryResponse.sendResponse(rc, 500, "FAILURE",
									"Some thing went wrong decrypting the response: ",
									new JsonArray()
											.add(new JsonObject().put("response", e.toString())));
							Response.setHandler(resu -> {
								if (resu.succeeded()) {
									Response.complete();
								} else {
									Response.fail(resu.cause());
								}
							});
						}
						LOGGER.info("Sending final response ");
						Response = QueryResponse.sendResponse(rc, 200, "SUCCESS", "Results Found", jarray);
						Response.setHandler(resu -> {
							if (resu.succeeded()) {
								Response.complete();
							} else {
								Response.fail(resu.cause());
							}
						});

					} else {
						Response = QueryResponse.sendResponse(rc, 404, "FAILURE",
								"No results found:", new JsonArray());
						Response.setHandler(resu -> {
							if (resu.succeeded()) {
								Response.complete();
							} else {
								Response.fail(resu.cause());
							}
						});

					}

Team any help on this will be appriciated .