more error logging in hnbap TX successful outcome
diff --git a/src/hnbap_common.c b/src/hnbap_common.c
index ec5ba4c..42a4b06 100644
--- a/src/hnbap_common.c
+++ b/src/hnbap_common.c
@@ -4,6 +4,7 @@
 
 #include "HNBAP-PDU.h"
 #include "hnbap_common.h"
+#include "hnbgw.h"
 
 int asn_debug = 0;
 int asn1_xer_print = 0;
@@ -55,16 +56,23 @@
 	HNBAP_PDU_t pdu;
 	struct msgb *msg = hnbap_msgb_alloc();
 	asn_enc_rval_t rval;
+	int rc;
 
 	memset(&pdu, 0, sizeof(HNBAP_PDU_t));
 	pdu.present = HNBAP_PDU_PR_successfulOutcome;
 	pdu.choice.successfulOutcome.procedureCode = procedureCode;
 	pdu.choice.successfulOutcome.criticality = criticality;
-	ANY_fromType_aper(&pdu.choice.successfulOutcome.value, td, sptr);
+	rc = ANY_fromType_aper(&pdu.choice.successfulOutcome.value, td, sptr);
+	if (rc < 0) {
+		LOGP(DMAIN, LOGL_ERROR, "Error in ANY_fromType_aper\n");
+		msgb_free(msg);
+		return NULL;
+	}
 
 	rval = aper_encode_to_buffer(&asn_DEF_HNBAP_PDU, &pdu,
 				     msg->data, msgb_length(msg));
 	if (rval.encoded < 0) {
+		LOGP(DMAIN, LOGL_ERROR, "Error encoding type %s\n", rval.failed_type->name);
 		msgb_free(msg);
 		return NULL;
 	}