question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Version 3.5.0 - Failing to Wrap Error Messages in Json.

See original GitHub issue

Version: 3.5.0 Base Framework: .NET Framework, jQuery MVC Steps needed to reproduce: Using the base template code provided for login, enter an invalid password for login. An HTML page is returned by the boilerplate and not a JSON with the error.

I can not get the boilerplate to return any UserFriendlyMessages, or really any errors for that matter, as a JSON. No matter how the request is done the return type of the method (ActionResult vs. JsonResult), the error is always sent back as an HTML page. This causes the boilerplate on AJAX calls to show an error message saying “Error Detail Not Sent By Server.” The HTML error response is correct with the correct exception, though it will never wrap it in JSON no matter the request or return type of the controller. This seems to be the case from the base template code or my own ajax and controller method I write.

I have attempted to upgrade to newer versions of Abp through the package manager to see if it was by chance fixed in later versions, though ran into issues of failing to load an assembly of System.ComponetModel when I attempted to run again, so I have reverted those changes back.

Was this issue and been solved in updated versions?

The following for login in Login.js:

            abp.ui.setBusy(
                $('#LoginArea'),

                abp.ajax({
                    contentType: 'application/x-www-form-urlencoded',
                    url: $loginForm.attr('action'),
                    data: $loginForm.serialize()
                })
            );

With the following method signature in the controller:

public async Task<JsonResult> Login(LoginViewModel loginModel, string returnUrl = "", string returnUrlHash = "")

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
chadsmith12commented, Jun 13, 2018

@ismcagdas Ahh yep that was it! The default template has it set to RemoteOnly which explains why I was not seeing Abp handle it properly locally.

0reactions
ismcagdascommented, Jun 8, 2018

@chadsmith12 what is the value of customErrors in the web.config ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Installation fails for @types/<dependency_name> packages
An error message states that the expected index.d.ts file cannot be found: yarn install v0.15.1 info No lockfile found.
Read more >
How to get error location from json.loads in Python
msg : The unformatted error message. doc : The JSON document being parsed. pos : The start index of doc where parsing failed....
Read more >
Official - A new Hub release is available - v3.5.0
Clicking "Restart" in the "A new version is available"-prompt to download and install the Hub version 3.5.0 just uninstalled the Unity Hub ...
Read more >
What Is JSON and How to Handle an “Unexpected Token” ...
To ensure the error happens on the exact line we think it does, we can wrap the JSON parsing code in a try-catch...
Read more >
Bug listing with status RESOLVED with resolution FIXED as at ...
configure" status:RESOLVED resolution:FIXED severity:normal · Bug:188 - "environment variable GZIP cause pilot-link-0.9.6.ebuild (kde) to fail ?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found