Skip to content

Commit def7e1b

Browse files
committed
change: error message
1 parent b689158 commit def7e1b

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

zstd.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ ZEND_FUNCTION(zstd_uncompress)
225225

226226
if (ZSTD_IS_ERROR(result)) {
227227
zend_string_efree(output);
228-
ZSTD_WARNING("can not decompress stream");
228+
ZSTD_WARNING("%s", ZSTD_getErrorName(result));
229229
RETURN_FALSE;
230230
}
231231

@@ -237,15 +237,15 @@ ZEND_FUNCTION(zstd_uncompress)
237237
stream = ZSTD_createDStream();
238238
if (stream == NULL) {
239239
zend_string_efree(output);
240-
ZSTD_WARNING("can not create stream");
240+
ZSTD_WARNING("failed to create decompress context");
241241
RETURN_FALSE;
242242
}
243243

244244
result = ZSTD_initDStream(stream);
245245
if (ZSTD_IS_ERROR(result)) {
246246
zend_string_efree(output);
247247
ZSTD_freeDStream(stream);
248-
ZSTD_WARNING("can not init stream");
248+
ZSTD_WARNING("%s", ZSTD_getErrorName(result));
249249
RETURN_FALSE;
250250
}
251251

@@ -268,7 +268,7 @@ ZEND_FUNCTION(zstd_uncompress)
268268
if (ZSTD_IS_ERROR(result)) {
269269
zend_string_efree(output);
270270
ZSTD_freeDStream(stream);
271-
ZSTD_WARNING("can not decompress stream");
271+
ZSTD_WARNING("%s", ZSTD_getErrorName(result));
272272
RETURN_FALSE;
273273
}
274274

@@ -308,14 +308,14 @@ ZEND_FUNCTION(zstd_compress_dict)
308308

309309
cctx = ZSTD_createCCtx();
310310
if (cctx == NULL) {
311-
ZSTD_WARNING("ZSTD_createCCtx() error");
311+
ZSTD_WARNING("failed to create compress context");
312312
RETURN_FALSE;
313313
}
314314

315315
cdict = ZSTD_createCDict(dict, dict_len, (int) level);
316316
if (!cdict) {
317317
ZSTD_freeCStream(cctx);
318-
ZSTD_WARNING("ZSTD_createCDict() error");
318+
ZSTD_WARNING("failed to load dictionary");
319319
RETURN_FALSE;
320320
}
321321

@@ -366,7 +366,7 @@ ZEND_FUNCTION(zstd_uncompress_dict)
366366

367367
ddict = ZSTD_createDDict(dict, dict_len);
368368
if (!ddict) {
369-
ZSTD_WARNING("ZSTD_createDDict() error");
369+
ZSTD_WARNING("failed to load dictionary");
370370
RETURN_FALSE;
371371
}
372372

@@ -376,7 +376,7 @@ ZEND_FUNCTION(zstd_uncompress_dict)
376376
if (dctx == NULL) {
377377
zend_string_efree(output);
378378
ZSTD_freeDDict(ddict);
379-
ZSTD_WARNING("ZSTD_createDCtx() error");
379+
ZSTD_WARNING("failed to create decompress context");
380380
RETURN_FALSE;
381381
}
382382

@@ -941,7 +941,7 @@ php_zstd_output_handler_load_dict(php_zstd_context *ctx, int level)
941941
REPORT_ERRORS, // | USE_PATH
942942
NULL, context);
943943
if (!stream) {
944-
ZSTD_WARNING("could not open dictionary stream: %s", dict);
944+
ZSTD_WARNING("failed to open dictionary stream: %s", dict);
945945
return;
946946
}
947947

0 commit comments

Comments
 (0)