Skip to content

Commit 372e596

Browse files
committed
Use compressed error messages
1 parent 665c1c9 commit 372e596

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

drivers/gc9a01/mp_uctx.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ static mp_obj_t mp_ctx_texture(size_t n_args, const mp_obj_t *args) {
386386
mp_ctx_obj_t *self = MP_OBJ_TO_PTR(args[0]);
387387

388388
if (!mp_get_buffer(args[1], &buffer_info, MP_BUFFER_READ)) {
389-
mp_raise_TypeError("not a buffer");
389+
mp_raise_TypeError(MP_ERROR_TEXT("not a buffer"));
390390
}
391391
int format = mp_obj_get_int(args[2]);
392392
int width = mp_obj_get_int(args[3]);
@@ -444,7 +444,7 @@ static mp_obj_t mp_ctx_get_font_name(mp_obj_t self_in, mp_obj_t no_in) {
444444
if (name)
445445
return mp_obj_new_str(name, strlen(name));
446446
else
447-
mp_raise_ValueError("font with given index does not exist");
447+
mp_raise_ValueError(MP_ERROR_TEXT("font with given index does not exist"));
448448
}
449449
MP_DEFINE_CONST_FUN_OBJ_2(mp_ctx_get_font_name_obj, mp_ctx_get_font_name);
450450

@@ -466,12 +466,12 @@ static mp_obj_t mp_ctx_add_stop(size_t n_args, const mp_obj_t *args) {
466466
alpha_f = (float)mp_obj_get_float(args[3]);
467467
}
468468
if (alpha_f < 0.0f || alpha_f > 1.0f) {
469-
mp_raise_ValueError("alpha must be between 0.0 or 1.0");
469+
mp_raise_ValueError(MP_ERROR_TEXT("alpha must be between 0.0 or 1.0"));
470470
}
471471

472472
mp_obj_t red_in, green_in, blue_in;
473473
if (mp_obj_get_int(mp_obj_len(color_in)) < 3) {
474-
mp_raise_ValueError("color must have 3 elements");
474+
mp_raise_ValueError(MP_ERROR_TEXT("color must have 3 elements"));
475475
}
476476
red_in = mp_obj_subscr(color_in, mp_obj_new_int(0), MP_OBJ_SENTINEL);
477477
green_in = mp_obj_subscr(color_in, mp_obj_new_int(1), MP_OBJ_SENTINEL);
@@ -647,7 +647,7 @@ static mp_obj_t mp_ctx_make_new(const mp_obj_type_t *type, size_t n_args,
647647

648648
if (!mp_get_buffer(args[ARG_buffer].u_obj, &buffer_info,
649649
MP_BUFFER_READ)) {
650-
mp_raise_TypeError("not a buffer");
650+
mp_raise_TypeError(MP_ERROR_TEXT("not a buffer"));
651651
}
652652
o->ctx = ctx_new_for_framebuffer(buffer_info.buf, width, height, stride,
653653
format);

drivers/tildagon_hmac/tildagon_hmac.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ static mp_obj_t tildagon_hmac_digest(mp_obj_t key_slot, mp_obj_t msg) {
1313
esp_err_t err = esp_hmac_calculate(key_id, bufinfo.buf, bufinfo.len, hmac);
1414

1515
if (err == ESP_FAIL) {
16-
mp_raise_msg(&mp_type_Exception, "HMAC key not provisioned!");
16+
mp_raise_msg(&mp_type_Exception, MP_ERROR_TEXT("HMAC key not provisioned!"));
1717
}
1818

1919
return mp_obj_new_bytes(hmac, 32);

0 commit comments

Comments
 (0)