[FIX] barcodes: handle error message on barcode scanning

Before this commit:
Got a traceback instead of an error message on scanning a barcode.

Reason:
Until 16.4 error message send in the object via Eventbus, which removed in
https://github.com/odoo/odoo/commit/72dbb75d4de529a35c45273ded472d038a7bb738 so because of that error message will be sent directly(not in object).

After this commit:
User will get an error message if anything wrong happened.

Task:3524284

closes odoo/odoo#138877

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit is contained in:
Jay Savaliya
2023-12-22 07:10:48 +00:00
parent cfa987933c
commit 35d3fb57d6
2 changed files with 33 additions and 1 deletions
@@ -21,7 +21,7 @@ export class BarcodeScanner extends Component {
try {
barcode = await scanBarcode(this.env, this.facingMode);
} catch (err) {
error = err.error.message;
error = err.message;
}
if (barcode) {