Error Message When Adding Data to Form Generated in Phreeze Framework

1

In all applications generated using the PHP Phreeze framework in local environment (Xampp), when you add a record through the form, which was also generated, you get the following error message for the user:

  

An unknown error occured

Below the 'app.js' file located in the 'scripts' folder, also generated by Phreeze :

getErrorMessage: function(resp) {
var msg = 'An unknown error occured';
    try
    {
        var json = $.parseJSON(resp.responseText);
        msg = json.message;
    }
    catch (error)
    {
        // TODO: possibly use regex or some other more robust way to get details...?
        var parts = resp.responseText.split(app.errorLandmarkStart);

        if (parts.length > 1)
        {
            var parts2 = parts[1].split(app.errorLandmarkEnd);
            msg = parts2[0]
        }
    }

    return msg ? msg : 'Unknown server error';
},

After refreshing the page, it turns out that the insert in the database has been successfully executed but is not visible on the client side of the application, it appears that there is a problem with JSON or somewhere in the view layer.

Has anyone ever had this same problem? Only ratifying the problem is only on the client side of the application, since the data is normally entered into the database.

    
asked by anonymous 17.01.2017 / 21:02

0 answers