IntrospectiveSystems / xGraph

Introspective Systems, developer of xGraph, collaborative AI platform for data systems
https://www.introspectivesystems.com/
GNU Affero General Public License v3.0
14 stars 3 forks source link

Improve invalid deferred module definition Error reporting #65

Closed Ahathaway97 closed 6 years ago

Ahathaway97 commented 6 years ago

When a deferred module is improperly formatted (like below, taken from testing the BankAccount and BankPatron test system) it throws nondescript unhandled promise rejection errors.

Proposed solution:

{
    "Sources": {
        "core": "mb://modulebroker.xgraphdev.com"
    },
    "Modules": {
        "BankAccount":{
            "Module": "xGraph.BankAccount", 
            "Source": "core",
            "Par": {
            }
        },
        "BankPatron":{
            "Module": "xGraph.BankPatron", 
            "Source": "core",
            "Par": {
            }
        },
        "Deferred": [
            {}
        ]
    }
}
valyrie97 commented 6 years ago

Implementation something along the lines of, test for the keys inside the deferred object first, then access them. If the format doesnt make sense, inform the user by dumping the object and throwing E_INVALID_FORMAT

tjgionet commented 6 years ago

Fixed by commit c7808ddd249964f7e0220560338b34b9b2a51aa8