Skip to content
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

[BUG] Better error reporting #643

Closed
lslocum opened this issue Sep 5, 2018 · 3 comments
Closed

[BUG] Better error reporting #643

lslocum opened this issue Sep 5, 2018 · 3 comments

Comments

@lslocum
Copy link

lslocum commented Sep 5, 2018

Overview of the issue

Came across an error on Process Page. The error that was printed out simply said TypeError: cannot read property 'text' of undefined. The page being processed did not reference a property of text. I placed a try catch around

        return this.compiledPage({
            data: o
        });

in HtmlEngine.prototype.render. This provided me the full stack trace I used to find where the error was coming from. It would be nice if the stack trace was provided by default.

Operating System, Node.js, npm, compodoc version(s)

Win 10, Node v8.1.6, npm v6.2.0, compodoc v1.1.5

Compodoc installed globally or locally ?

locally

If possible sourcecode of the file where it breaks

Here is where the error was occuring BTW:

    FunctionSignatureHelper.prototype.handleFunction = function (arg) {
        var _this = this;
        if (arg.function.length === 0) {
            return "" + arg.name + this.getOptionalString(arg) + ": () => void";
        }
        var argums = arg.function.map(function (argu) {
            var _result = _this.dependenciesEngine.find(argu.type);
            if (_result) {
                if (_result.source === 'internal') {
                    var path$$1 = _result.data.type;
                    if (_result.data.type === 'class') {
                        path$$1 = 'classe';
                    }
                    return "" + argu.name + _this.getOptionalString(arg) + ": <a href=\"../" + path$$1 + "s/" + _result.data.name + ".html\">" + argu.type + "</a>";
                }
                else {
                    var path$$1 = _this.angularVersionUtil.getApiLink(_result.data, _this.configuration.mainData.angularVersion);
                    return "" + argu.name + _this.getOptionalString(arg) + ": <a href=\"" + path$$1 + "\" target=\"_blank\">" + argu.type + "</a>";
                }
            }
            else if (_this.basicTypeUtil.isKnownType(argu.type)) {
                var path$$1 = _this.basicTypeUtil.getTypeUrl(argu.type);
                return "" + argu.name + _this.getOptionalString(arg) + ": <a href=\"" + path$$1 + "\" target=\"_blank\">" + argu.type + "</a>";
            }
            else {
                if (argu.name && argu.type) {
                    return "" + argu.name + _this.getOptionalString(arg) + ": " + argu.type;
                }
                else {
                    return "" + argu.name.text; // this is the breaking line when the anonymous function does not name its parameter
                }
            }
        });
        return "" + arg.name + this.getOptionalString(arg) + ": (" + argums + ") => void";
    };
Suggest a Fix

Put some try catches with error logging to get the full stack trace. Maybe also have a wiki that has some troubleshooting tips.

@vogloblinsky
Copy link
Contributor

thanks for the informations
can i have the source code of the file which had his rendered page broken ?

@lslocum
Copy link
Author

lslocum commented Sep 5, 2018

public openSomeDialog(model, grid, callback: ({ index }) => {}): void {
  ...
}

Since the parameter to the callback method wasn't named argu.name was undefined and agru.type was ''. When I gave the parameter a name the error was resolved. It now looks like this

public openSomeDialog(model, grid, callback: (event: { index }) => {}): void {
  ...
}

@vogloblinsky vogloblinsky changed the title [Request] Better error reporting [BUG] Better error reporting Sep 6, 2018
@vogloblinsky vogloblinsky added this to the 1.2.0 milestone Sep 6, 2018
@vogloblinsky vogloblinsky removed this from the 1.2.0 milestone Feb 23, 2019
@lock
Copy link

lock bot commented Sep 30, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem. Why locking ? Having issues with the most up-to-date context.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants