@projetoacbr/acbrlib-base-node 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/index.js +4 -7
- package/package.json +1 -1
package/dist/src/index.js
CHANGED
|
@@ -115,7 +115,7 @@ class ACBrLibBaseMT {
|
|
|
115
115
|
}
|
|
116
116
|
getHandle() {
|
|
117
117
|
if (!this.#isInitialized()) {
|
|
118
|
-
throw new exception_1.ACBrLibLibNaoInicializadaError(
|
|
118
|
+
throw new exception_1.ACBrLibLibNaoInicializadaError(`Biblioteca ${this.constructor.name} não inicializada. Chame o método inicializar antes de usar outros métodos.`);
|
|
119
119
|
}
|
|
120
120
|
return koffi.decode(this.handle, 'void *');
|
|
121
121
|
}
|
|
@@ -238,9 +238,6 @@ class ACBrLibBaseMT {
|
|
|
238
238
|
ultimoRetorno() {
|
|
239
239
|
const env_3 = { stack: [], error: void 0, hasError: false };
|
|
240
240
|
try {
|
|
241
|
-
if (!this.#isInitialized()) {
|
|
242
|
-
return "";
|
|
243
|
-
}
|
|
244
241
|
const acbrBuffer = __addDisposableResource(env_3, new ACBrBuffer_2.default(ACBrBuffer_1.TAMANHO_PADRAO), false);
|
|
245
242
|
this.LIB_UltimoRetorno(this.getHandle(), acbrBuffer.getBuffer(), acbrBuffer.getRefTamanhoBuffer());
|
|
246
243
|
return this._processaResult(acbrBuffer);
|
|
@@ -384,11 +381,11 @@ class ACBrLibBaseMT {
|
|
|
384
381
|
if (!this._isResultErrorCode(result)) {
|
|
385
382
|
return;
|
|
386
383
|
}
|
|
387
|
-
let errorMessage = this
|
|
388
|
-
|
|
384
|
+
let errorMessage = this.#isInitialized()
|
|
385
|
+
? this.ultimoRetorno() : "Biblioteca não inicializada";
|
|
389
386
|
switch (result) {
|
|
390
387
|
case ACBrLibResultCodes_1.ACBrLibResultCodes.ErrLibNaoInicializada:
|
|
391
|
-
throw new exception_1.ACBrLibLibNaoInicializadaError("Erro ao inicializar " + this.
|
|
388
|
+
throw new exception_1.ACBrLibLibNaoInicializadaError("Erro ao inicializar " + this.constructor.name);
|
|
392
389
|
break;
|
|
393
390
|
case ACBrLibResultCodes_1.ACBrLibResultCodes.ErrLibNaoFinalizada:
|
|
394
391
|
throw new exception_1.ACBrLibLibNaoFinalizadaError("Erro ao finalizar a biblioteca");
|