mirror of
https://github.com/gnosygnu/xowa.git
synced 2024-10-27 20:34:16 +00:00
Lang: Add more error message detail to track 'counts do not match' [#330]
This commit is contained in:
parent
a5f8b6e482
commit
be4d2fdfb4
@ -64,7 +64,8 @@ public class Xol_lang_itm implements Gfo_invk {
|
|||||||
fallback_hash.Add_as_key_and_val(String_.new_u8(key));
|
fallback_hash.Add_as_key_and_val(String_.new_u8(key));
|
||||||
}
|
}
|
||||||
} catch (Exception exc) {
|
} catch (Exception exc) {
|
||||||
throw Err_.new_wo_type("failed to add fallback_bry_ary; v=~{0} err=~{1}", v, Err_.Message_gplx_log(exc));
|
String[] cur_fallbacks = (String[])fallback_hash.To_ary(String.class);
|
||||||
|
throw Err_.new_wo_type(String_.Format("failed to add fallback_bry_ary; lang={0} cur_fallbacks={1} new_fallbacks={2} err={3}", key_str, cur_fallbacks, v, Err_.Message_gplx_log(exc)));
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
} private byte[] fallback_bry;
|
} private byte[] fallback_bry;
|
||||||
|
@ -263,7 +263,13 @@ public class Scrib_lib_language implements Scrib_lib {
|
|||||||
}
|
}
|
||||||
private Xol_lang_itm lang_(Scrib_proc_args args) {
|
private Xol_lang_itm lang_(Scrib_proc_args args) {
|
||||||
byte[] lang_code = args.Cast_bry_or_null(0);
|
byte[] lang_code = args.Cast_bry_or_null(0);
|
||||||
Xol_lang_itm lang = lang_code == null ? null : core.App().Lang_mgr().Get_by_or_load(lang_code);
|
Xol_lang_itm lang = null;
|
||||||
|
try {
|
||||||
|
lang = lang_code == null ? null : core.App().Lang_mgr().Get_by_or_load(lang_code);
|
||||||
|
}
|
||||||
|
catch (Exception exc) {
|
||||||
|
throw Err_.new_wo_type("mw.lang: Unable to get lang", "page", core.Page().Url_bry_safe(), "lang", lang_code, "err", Err_.Message_gplx_log(exc));
|
||||||
|
}
|
||||||
if (lang == null) throw Err_.new_wo_type("lang_code is not valid", "lang_code", String_.new_u8(lang_code));
|
if (lang == null) throw Err_.new_wo_type("lang_code is not valid", "lang_code", String_.new_u8(lang_code));
|
||||||
return lang;
|
return lang;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user