New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected localized exceptions when thrown via WebAPI #24660
Comments
Hi @ValeSauer. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. @ValeSauer do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?
|
@magento give me 2.3-develop instance |
Hi @ValeSauer. Thank you for your request. I'm working on Magento 2.3-develop instance for you |
Hi @ValeSauer, here is your Magento instance. |
Hi @engcom-Charlie. Thank you for working on this issue.
|
✅ Confirmed by @engcom-Charlie Issue Available: @engcom-Charlie, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself. |
The described issue contradicts this one: #19908 |
Software usually provides machine readable error codes in addition to human readable error descriptions to avoid this issue. A frontend application that requires localized error messages must still contain localizations. So it could also handle the localization of error messages. I think this code, which is necessary to react on error massages, says it all: var apiCall = async function (request_data, retry = 0) {
try {
var result = await performApiCall(request_data, retry)
return result
} catch (e) {
if (e && typeof (e) == 'string' && (
e.indexOf("URL key for specified store already exists.") >= 0 ||
e.indexOf("URL klíč ve zvoleném obchodě již existuje.") >= 0 ||
e.indexOf("La clé d’URL pour la boutique existe déjà.") >= 0 ||
e.indexOf("URL-Schlüssel für angegebenen Store ist bereits vorhanden") >= 0 ||
e.indexOf("Esiste già una URL key per il negozio specificato.") >= 0 ||
e.indexOf("URL sleutel voor opgegeven winkel bestaat al.") >= 0 ||
e.indexOf("Klucz URL dla wybranego sklepu już istnieje.") >= 0 ||
e.indexOf("Belirtilen mağaza için URL anahtarı zaten var.") >= 0 ||
e.indexOf("La clave de URL para la tienda especificada ya existe.") >= 0
) && retry <= MAXURLRETRIES) { Therefore I suggest the following approach:
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Thank you for your contributions. |
Hi @ValeSauer. Thank you for your report and collaboration! The related internal Jira ticket The fix will be available with the upcoming |
@magento give me 2.4.3 instance |
Hi @isxam. Thank you for your request. I'm working on Magento instance for you. |
Hi @isxam, here is your Magento Instance: https://69932c9ab5eeaafc4ecf43842e9b5539-2-4-3.instances.magento-community.engineering |
This is still an issue and it’s very annoying because you can’t reliably identify errors in a generic way because the exact wording depends on the locale. |
Preconditions (*)
Steps to reproduce (*)
Unfortunately I have no idea how to trigger a 500 error via REST API. It usually happens by chance when there are database issues or something similar. However, the following steps could help to reproduce it.
Expected result (*)
Actual result (*)
The text was updated successfully, but these errors were encountered: