Add detailed info to the error message

Created on 13 February 2023, almost 2 years ago

Problem/Motivation

When an exception is thrown is very difficult to know from where the error comes.

Example, here is the output of an error:

  @behat @javascript
  Scenario: Selenium driver works
    Given I go to "/"
    │
    │  -------------------------------------------------------------
    │  /var/www/html/tests/behat/features/behat.feature:13
    │  Found 1 javascript errors
    │  -------------------------------------------------------------
    │     #0: Uncaught SyntaxError: Unexpected token .
    │  
    │
    ╳  Found 1 javascript errors (Exception)
    │
    └─ @AfterStep 

Proposed resolution

Extend the message with the filename, example extracted from Get the actual Javascript Error object with window.onerror

window.onerror = function(message, filename, lineno, colno, error)
{
    if(error != null)
    {
        //handle the error with stacktrace in error.stack
    }
    else
    {
        //sadly only 'message', 'filename' and 'lineno' work here
    }
};
Feature request
Status

Fixed

Version

1.0

Component

Code

Created by

🇪🇸Spain eduardo morales alberti Spain, 🇪🇺

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024