Could you add some more information. Is this from SSJS or Java? If SSJS, is it SSJS inline on an XPage/ Custom Control or SSJS in a Script Library?
For Java, the stack trace will provide the line number.
For inline SSJS, the line number should be shown as it is by a custom error page.
For Script Libraries, I don't think an error line is provided by the platform, so I don't think that's possible.