Skip to content

Commit 663e666

Browse files
committed
Revert "zstd: factor common parts of set_zstd_error()"
This reverts commit e02f66c.
1 parent 9cb7a3d commit 663e666

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

Modules/_zstd/_zstdmodule.c

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,44 +28,43 @@ set_zstd_error(const _zstd_state* const state,
2828
switch (type)
2929
{
3030
case ERR_DECOMPRESS:
31-
msg = "decompress zstd data";
31+
msg = "Unable to decompress zstd data: %s";
3232
break;
3333
case ERR_COMPRESS:
34-
msg = "compress zstd data";
34+
msg = "Unable to compress zstd data: %s";
3535
break;
3636
case ERR_SET_PLEDGED_INPUT_SIZE:
37-
msg = "set pledged uncompressed content size";
37+
msg = "Unable to set pledged uncompressed content size: %s";
3838
break;
3939

4040
case ERR_LOAD_D_DICT:
41-
msg = "load zstd dictionary or prefix for decompression";
41+
msg = "Unable to load zstd dictionary or prefix for decompression: %s";
4242
break;
4343
case ERR_LOAD_C_DICT:
44-
msg = "load zstd dictionary or prefix for compression";
44+
msg = "Unable to load zstd dictionary or prefix for compression: %s";
4545
break;
4646

4747
case ERR_GET_C_BOUNDS:
48-
msg = "get zstd compression parameter bounds";
48+
msg = "Unable to get zstd compression parameter bounds: %s";
4949
break;
5050
case ERR_GET_D_BOUNDS:
51-
msg = "get zstd decompression parameter bounds";
51+
msg = "Unable to get zstd decompression parameter bounds: %s";
5252
break;
5353
case ERR_SET_C_LEVEL:
54-
msg = "set zstd compression level";
54+
msg = "Unable to set zstd compression level: %s";
5555
break;
5656

5757
case ERR_TRAIN_DICT:
58-
msg = "train zstd dictionary";
58+
msg = "Unable to train zstd dictionary: %s";
5959
break;
6060
case ERR_FINALIZE_DICT:
61-
msg = "finalize zstd dictionary";
61+
msg = "Unable to finalize zstd dictionary: %s";
6262
break;
6363

6464
default:
6565
Py_UNREACHABLE();
6666
}
67-
PyErr_Format(state->ZstdError, "Unable to %s: %s",
68-
msg, ZSTD_getErrorName(zstd_ret));
67+
PyErr_Format(state->ZstdError, msg, ZSTD_getErrorName(zstd_ret));
6968
}
7069

7170
typedef struct {

0 commit comments

Comments
 (0)