Not able to publish/subcribe to topics on MQTT broker, Error handling enquiry

I am trying to interface an ESP-32-WROOM with the EC20 module, And connect it to an MQTT broker to test and publish messages. Currently not using SSL since this is an alpha test, might use SSL for the final product.

I am unable to subscribe and publish to topics, although connecting to the MQTT broker does not seem to be a problem? Am I missing anything specific?

Are there any libraries or APIs I can use to handle errors/auto check for errors when I take input into the serial monitor (of the Arduino IDE which I use to code the ESP32) while interfacing with the EC20? I would like to handle such errors in my code in a more simple manner without doing an if else statement for every case.

Note: I am using the HIVEMQ websocket client for all my MQTT purposes currently.
AT command logs are below:(I added spaces between websites because I am unable to add more than 2 websites)

ATE1

OK
AT+CGREG?

+CGREG: 0,1

OK
AT+COPS?

+COPS: 0,0,“IND airtel airtel”,7

OK
AT+QIACT?

+QIACT: 1,1,1,“100.98.255.208”

OK
AT+QMTCFG=“recv/mode”,0,0,1

OK
AT+QMTOPEN=0," [broker. hivemq. com](http:// broker. hivemq. com/)",8884

OK

+QMTOPEN: 0,4
AT+QMTOPEN=0,“[broker. hivemq. com](http:// broker. hivemq. com/)”,8884

OK

+QMTOPEN: 0,0
AT+QMTCONN=0,“clientexample”

OK

+QMTSTAT: 0,1
AT+QMTCONN=0,“clientId-G4bt2uPbPb”

ERROR
AT+QMTCONN=0,“clientId-G4bt2uPbPb”,“”,“”

ERROR
AT+QMTCONN=0,“clientId-G4bt2uPbPb”,

ERROR
AT+QMTCONN=0,“clientId-G4bt2uPbPb”,“terra”,“Speed@123”

ERROR
AT+QMTCONN=0,“clientId-G4bt2uPbPb”,“bruh”,“Bruh@123”

ERROR
AT+QMTCONN=0,“clientId-h5qYis2202”,“bruh”,“Bruh@123”

ERROR
AT+QMTCONN=0,“clientId-h5qYis2202”[,“bruh”,“Bruh@123”]

ERROR
AT+QMTOPEN?

+QMTOPEN: 1,“[broker. hivemq. com](http:// broker. hivemq. com/)”,8884

OK
AT+QMTCONN=1,“clientId-h5qYis2202”[,“bruh”,“Bruh@123”]

OK

+QMTCONN: 1,1
AT+QMTCONN?

+QMTCONN: 1,2

OK

+QMTSTAT: 1,3
AT+QMTCONN?

OK
AT+QMTPUB=1,0,0,0,“bruhtest1”,10

ERROR
AT+QMTPUBEX=1,0,0,0,“bruhtest1”,10

ERROR
AT+QMTPUBEX=1,0,0,1,“bruhtest1”,10

ERROR
AT+QMTPUBEX=1,0,0,1,“/bruhtest1”,10

ERROR
AT+QMTPUBEX=0,0,0,1,“bruhtest1”,10

ERROR
AT+QMTPUB=1,0,0,0,“bruhtest1”

ERROR
AT+QMTPUBEX=1,0,0,0,“bruhtest1”

ERROR
AT+QMTPUBEX=1,0,0,0,“bruhtest1”,“Hello world”

ERROR

Your MQTT connection is failing, you can try your mqtt server on MQTTFX to see if it is available.
image