How to get a more specific "why" of the error? - node.js

In my Node backend, I am using Express-validator to do some request body checks. For some reason if I include the code to check one of the form values, it will always give me an error "Invalid Value" (the default error message).
My question is: Is there any way to get more specifics about the error? From what I know about it, all I can get is which one it is throwing the error on, what the value is, and what the error is. But I can't find why the value is invalid... and I can't really fix it, if I don't know why.
What should I do? I have looked at the API documentation for express-validator, but haven't found anything that might help.

Thanks to Heiko Theißen's comment, I went to check/test my validation again, and eventually figured out that the problem was my custom validator, I wasn't returning the [collection].findById() and so when I return the value in there, it didn't work.
So if you are having this problem, please check custom validators, and add the .withMessage() to other validators.
If you think your custom validators are all correct and you still get the error, comment out your custom validators (and add a built in one if necessary).
If you still get the error, you now know that it has something to do with your custom validator.

Related

MalformedResponse at expected_inputs[0]: Responses must provide at least one possible intent if this is not the final response. What does it mean?

I created a very simple agent on dialogflow. Every now and then, even using static responses (where only the session ID changes), the application crashes (both on Google Assistant and in the simulator).
On the logs I find the message in question: "MalformedResponse at expected_inputs [0]: Responses must provide at least one possible if this is not the final response. What does it mean?".
I don't understand what it means.
Could anyone help me?
I'm having the same problem. That i've noted is that this problem doesn't ocurre every time. The behavior is really unstable.
I'm using 2 required parameters in the intent. I don't know if that has something to do with the problem.
MalformedResponse at expected_inputs[0].input_prompt: 'input_prompt' is empty
MalformedResponse at expected_inputs[0]: Responses must provide at least one possible intent if this is not the final response
The problem, appears to be caused when you use own parameters, not when use sys. parameters.
Google answer me the following:
"Hi Alberto,
This issue has already been escalated to our engineering team. You are correct about required parameters causing the problem. Our engineering team is working thoroughly to resolve this since it is affecting some other AoG projects as well. "
I was facing the exact same issue when I was using custom entities as input parameters to my action.
I was asking for 2 custom parameters and one system (sys.color) and triggering the same with input prompts.
I found a workaround for that by taking all 3 in separate intents and using the response of the previous intent as a trigger to enter the next parameter, also by making the training phrases as sample values of the custom parameter.
I am still in contact with Dialogflow Suppport and waiting for bug fix but it works for now.

DSpace - OAI-PMH - Pagination

I would like to illustrate a problem with the pagination of the results of the OAI-PMH Data Provider of DSpace.
Let's assume that I display the first page of results of a specific type, in the context the Identifiers.
The URL of the request ends as shown here:
".../oaidl.jsp?verb=&ListIdentifiers&metadataPrefix=pico"
Until here, no problem. However, when selecting the Show More button, using exactly the Resumption Token indicated at the end of the first request response:
".../oaidl.jsp?verb=ListIdentifiers&resumptionToken=9999-12-31|1753-01-01|null|pico|982|2019-03-02T14%3A29%3A11Z"
I get an error page with the following message:
"XML interpretation error: no root element found..."
Can you tell me my mistake and, if possible, how can I solve it?
Thank you very much in advance!
Which version of DSpace are you running? The reference implementation at demo.dspace.org has a different url pattern than your example.
http://demo.dspace.org/oai/request?verb=Identify

What does the error msg ENVELOPE_HAS_DUPLICATE_RECIPIENTS mean?

Looking at the envelope JSON there is only one recipient email. So this must indicate some other issue. Can someone steer me toward something in the docs that talks about it?
Thanks
I suggest that you use the API Logging feature to see exactly what DocuSign is receiving from your application.
If that doesn't help you solve the problem then edit your question to add the logger's output.
Use a tool such as JSON Pretty print to format your API request.
You'll also need to add 4 spaces per line so StackOverflow recognizes it as software/JSON for proper display.
The answer is it means the request JSON has duplicate RECIPIENTS arrays. It doesn't mean, at least in this case, there is a problem with recipient data.
And as far as a list of error codes there simply isn't one yet.
In this particular instance my code assembling the request incorrectly wrote the recipients array. A better message would be MALFOMED_JSON_REQUEST or such since that's what the problem actually was. Once I stopped looking at the recipients data I realized the problem.

Accessing Area.Name Throws Error

I'm just trying to find a way to access the name property of an Area element inside Revit Python Shell, tried looking on Jeremy Tammik's amazingly informative blog, tried AUGI, Revit API docs, been looking for 2 days now...
Tried accessing via a bunch of ways, FilteredElementsCollector(doc).OfCategory(BuiltInCategory.OST_Areas), tried by Area class, tried through AreaTag, every single time I get an error under every circumstance and it's driving me nuts, it seems like such a simple issue that I can't seem to grasp!
EDIT: Also tried by element id, through tags, through area schemes, nada, no go...
Can anyone please tell me how to access this property via RPS?
I would say two things:
areaObject.LookupParameter("Name")
areaObject.GetParameters("Name")
...are valid methods. Please notice how I used GetParameters() NOT GetParameter(). There are some drawbacks to using either one of the two. The lookup method will return FIRST parameter that matches the name which in many cases might be a different parameter for different elements. It's not very reliable.
GetParameters() method will return them all if there are multiple so then you have to deal with a List<Parameter> rather than a single object that you can extract your value from.
I would personally recommend to use areaObject.get_Parameter(BuiltInParameter.ROOM_NAME) method to extract a Name value from Area object. The BuiltInParameter always points at the same parameter, and will reliably return just that one parameter. Here's a little more details about these methods:
http://www.revitapidocs.com/2018/4400b9f8-3787-0947-5113-2522ff5e5de2.htm
To answer my own question, I actually never thought of looking through the code of other Revit Python scripts... in this case of PyRevit, which is in my opinion far more eloquently written than RPS, raelly looking forward for their console work to be done!
Basically, I had mistakenly used GetParameter('parameter') instead of LookupParameter('parameter').
As I said, it was something stupidly simple that I just didn't understand.
If anyone has sufficient knowledge to coherently clarify this, please do answer!
Many thanks!
Maybe your issue is the same as this one ? :
https://groups.google.com/forum/#!searchin/RevitPythonShell/name|sort:relevance/revitpythonshell/uaxB1FLXG80/sdJNrTfoPuUJ
Your_Area.Name # throws error
Element.Name.GetValue(Your_Area) # works great

Is there a way to tell whether StorageArea.remove actually removed something?

Is there a way to know whether a call to StorageArea.remove actually removed something (and if it did, how many items)?
The documentation doesn't seem to say anything about it, and I'm hoping there is some way to do that that doesn't require calling get first to check whether something is there.
Since, as you can see from the docs, the callback has no parameters - no, nothing is reported, except for errors through an API variable.
The route with get first is the right one.
Semantically, remove is "make sure those elements aren't there". That's exactly what it does.

Resources