I want to get only new emails not reply or forwarded emails.
Here is my query:
(subject:return NOT "re:" OR subject:shipment NOT "re:") AND (attachment: return NOT exception OR attachment:shipment NOT exception) AND (subject:return NOT adjustment) AND (subject:return NOT "fw:" OR subject:shipment NOT "fw:")
But I get these error instead. These query runs fine in MS Outlook application.
{
"status": 400,
"message": "Syntax error: character ':' is not valid at position 24 in '\"(subject:return NOT \"re:\" OR subject:shipment NOT \"re:\") AND (attachment: return NOT exception OR attachment:shipment NOT exception) AND (subject:return NOT adjustment) AND (subject:return NOT \"fw:\" OR subject:shipment NOT \"fw:\")\"'.\r\nclientRequestId: c6f3d1e1-b137-4c5d-acfd-1434ff85a610\r\nserviceRequestId: 2925969d-f4df-4a84-90b1-b9977f08a024",
"error": {
"message": "Syntax error: character ':' is not valid at position 24 in '\"(subject:return NOT \"re:\" OR subject:shipment NOT \"re:\") AND (attachment: return NOT exception OR attachment:shipment NOT exception) AND (subject:return NOT adjustment) AND (subject:return NOT \"fw:\" OR subject:shipment NOT \"fw:\")\"'."
},
"source": "office365-wus2.azconn-wus2.p.azurewebsites.net"
}
You need to use the "/" escape character as explained here
| Escape | Replace: ‘"’, ‘\”‘ |
Related
const quotedAmountOut = await quoterContract.callStatic.quoteExactInputSingle(
immutables.token0,
immutables.token1,
immutables.fee,
amountIn,
0
)
I created two erc20 dummy tokens and created a pool for them using uniswapV3Factory createPool() method and obtained the pool address. But when I wanted to fetch the spot price for the tokens i have used using the above script it is throwing following Error:
Error: call revert exception; VM Exception while processing transaction: reverted with reason string "LOK" [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (method="quoteExactInputSingle(address,address,uint24,uint256,uint160)", data="0x08c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000034c4f4b0000000000000000000000000000000000000000000000000000000000", errorArgs=["LOK"], errorName="Error", errorSignature="Error(string)", reason="LOK", code=CALL_EXCEPTION, version=abi/5.7.0)
at Logger.makeError (/Users/apple/Desktop/solidity/deploy/node_modules/#ethersproject/contracts/lib/index.js:20:58)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
reason: 'LOK',
code: 'CALL_EXCEPTION',
method: 'quoteExactInputSingle(address,address,uint24,uint256,uint160)',
data: '0x08c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000034c4f4b0000000000000000000000000000000000000000000000000000000000',
errorArgs: [ 'LOK' ],
errorName: 'Error',
errorSignature: 'Error(string)',
address: '0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6',
args: [
'<Token-1-Address>',
'<Token-2-Address>',
500,
BigNumber { _hex: '0x0de0b6b3a7640000', _isBigNumber: true },
0
],
transaction: {
data: '0xf7729d4300000000000000000000000008a2e53a8ddd2dd1d895c18928fc63778d97a55a0000000000000000000000006d7a02e23505a74143199abb5fb07e6ea20c6d6300000000000000000000000000000000000000000000000000000000000001f40000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000000000000000000',
to: '0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6'
}
}
i found the issue here is your token address you provided, like token0 is WETH9 you must provide the exactly WETH9 token address, you can find it on etherscan.io
I have a JSON-RPC service defined in an XPages application using the <xe:jsonRpcService> tag.
If a request to this server causes a JSON parsing error, a verbose error message is returned, example:
{
"code": 400,
"text": "Bad Request",
"message": "Error when parsing JSON stream",
"type": "text",
"data": "com.ibm.domino.services.ServiceException: \r\n\tat com.ibm.domino.services.rpc.RpcServiceEngine.renderService(RpcServiceEngine.java:82)\r\n\tat com.ibm.domino.services.HttpServiceEngine.processRequest(HttpServiceEngine.java:168)\r\n\tat com.ibm.xsp.extlib.component.rpc.UIJsonRpcService._processAjaxRequest(UIJsonRpcService.java:299)\r\n\tat com.ibm.xsp.extlib.component.rpc.UIJsonRpcService.processAjaxRequest(UIJsonRpcService.java:282)\r\n\tat com.ibm.xsp.util.AjaxUtilEx$1.invokeContextCallback(AjaxUtilEx.java:194)\r\n\tat javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:862)\r\n\tat javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:878)\r\n\tat javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:878)\r\n\tat javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:878)\r\n\tat javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:878)\r\n\tat com.ibm.xsp.component.UIViewRootEx.invokeOnComponent(UIViewRootEx.java:1552)\r\n\tat com.ibm.xsp.util.AjaxUtilEx.renderAjaxPartialLifecycle(AjaxUtilEx.java:188)\r\n\tat com.ibm.xsp.webapp.FacesServletEx.renderAjaxPartial(FacesServletEx.java:249)\r\n\tat com.ibm.xsp.webapp.FacesServletEx.serviceAjaxPartialView(FacesServletEx.java:200)\r\n\tat com.ibm.xsp.webapp.FacesServletEx.serviceAjaxPartialViewSync(FacesServletEx.java:176)\r\n\tat com.ibm.xsp.webapp.FacesServletEx.serviceView(FacesServletEx.java:155)\r\n\tat com.ibm.xsp.webapp.FacesServlet.service(FacesServlet.java:159)\r\n\tat com.ibm.xsp.webapp.FacesServletEx.service(FacesServletEx.java:138)\r\n\tat com.ibm.xsp.webapp.DesignerFacesServlet.service(DesignerFacesServlet.java:103)\r\n\tat com.ibm.designer.runtime.domino.adapter.ComponentModule.invokeServlet(ComponentModule.java:588)\r\n\tat com.ibm.domino.xsp.module.nsf.NSFComponentModule.invokeServlet(NSFComponentModule.java:1335)\r\n\tat com.ibm.designer.runtime.domino.adapter.ComponentModule$AdapterInvoker.invokeServlet(ComponentModule.java:865)\r\n\tat com.ibm.designer.runtime.domino.adapter.ComponentModule$ServletInvoker.doService(ComponentModule.java:808)\r\n\tat com.ibm.designer.runtime.domino.adapter.ComponentModule.doService(ComponentModule.java:577)\r\n\tat com.ibm.domino.xsp.module.nsf.NSFComponentModule.doService(NSFComponentModule.java:1319)\r\n\tat com.ibm.domino.xsp.module.nsf.NSFService.doServiceInternal(NSFService.java:662)\r\n\tat com.ibm.domino.xsp.module.nsf.NSFService.doService(NSFService.java:482)\r\n\tat com.ibm.designer.runtime.domino.adapter.LCDEnvironment.doService(LCDEnvironment.java:357)\r\n\tat com.ibm.designer.runtime.domino.adapter.LCDEnvironment.service(LCDEnvironment.java:313)\r\n\tat com.ibm.domino.xsp.bridge.http.engine.XspCmdManager.service(XspCmdManager.java:272)\r\nCaused by: com.ibm.commons.util.io.json.JsonException: Error when parsing JSON stream\r\n\tat com.ibm.commons.util.io.json.JsonParser.fromJson(JsonParser.java:86)\r\n\tat com.ibm.domino.services.rpc.RpcServiceEngine.renderService(RpcServiceEngine.java:55)\r\n\t... 29 more\r\nCaused by: com.ibm.commons.util.io.json.parser.ParseException: Encountered \" <IDENTIFIER> \"x \"\" at line 1, column 39.\r\nWas expecting one of:\r\n \"false\" ...\r\n \"null\" ...\r\n \"true\" ...\r\n <INTEGER_LITERAL> ...\r\n <FLOATING_POINT_LITERAL> ...\r\n <STRING_LITERAL> ...\r\n \"{\" ...\r\n \"[\" ...\r\n \r\n\tat com.ibm.commons.util.io.json.parser.Json.generateParseException(Json.java:637)\r\n\tat com.ibm.commons.util.io.json.parser.Json.jj_consume_token(Json.java:572)\r\n\tat com.ibm.commons.util.io.json.parser.Json.literal(Json.java:230)\r\n\tat com.ibm.commons.util.io.json.parser.Json.propertyNameAndValueList(Json.java:274)\r\n\tat com.ibm.commons.util.io.json.parser.Json.objectLiteral(Json.java:244)\r\n\tat com.ibm.commons.util.io.json.parser.Json.parseJson(Json.java:383)\r\n\tat com.ibm.commons.util.io.json.JsonParser.fromJson(JsonParser.java:84)\r\n\t... 30 more\r\n"
}
Is there anyway to disable this message? Or at least remove the stack trace in the data?
I have the following problem:
my application is a bridge between dbus and json-rpc.
I have a dbus library that in case of Dbus exception is raising a
DBusException("my err msg") exception.
My json-rpc library is catching all the Exception and convert it to a nice generic server error message
{"jsonrpc": "2.0", "error": {"code": -32000, "message": "Server error"}, "id": 2}
The problem is that i want to handle better those exceptions and I can distinguish between them only using the error message:
for example I need to convert the
DBusException("Invalid Parameters")
to
{"jsonrpc": "2.0", "error": {"code": -32001, "message": "Server error", data="Invalid Parameters" }, "id": 2}
that can be done raising in my library an ApiError(msg, code, data) exception.
So summarizing:
- I need to catch a DBusException
- based on the err_msg I need to switch between different exception types and re-raise a modified
ApiError exception
How is the better approach to that? this needs to be done in at least 10 functions that have the same exceptions.
1) using a decorator?
def my_exception_catcher(fun, *args, **kwargv):
try:
fun(args, *argv)
except DBusException as e
err_msg = str(e)
if err_msg == "Invalid Arguments":
raise ApiError("Server Error", code=1, data=err_msg)
else if err_msg == "Connect Error":
raise ApiError("Server Error", code=2, data=err_msg)
else:
raise
#my_exception_catcher
my_fun(*args):
do_something
2) using a function to determine the exception type?
def find_my_dbus_error(err_msg):
if err_msg == "Invalid Arguments":
return ApiError("Server Error", code=1, data=err_msg)
else if err_msg == "Connect Error":
return ApiError("Server Error", code=2, data=err_msg)
else:
return Exception(err_msg)
try:
my_fun(params)
except DBusException as e
raise find_my_dbus_error(err_msg)
3) something else?
Thanks
Nick
I have a basic controller setup:
#Controller('')
export class AController {
#Get(':id')
async getThing(#Param('id', ParseUUIDPipe) id: string): Promise<RegisterRead[] | IntervalRead[]> {
return id
}
}
And I get the following error:
{
"statusCode": 400,
"error": "Bad Request",
"message": "Validation failed (uuid vundefined is expected)"
}
Also see: https://github.com/nestjs/nest/issues/2960
This issue was caused because I did not have a version specified. It shows version as an optional field, but it appears to be required:
new ParseUUIDPipe({version: '4'})
I'm on Windows and I'm trying to use the cURL API provided by Retargetable Decompiler. Since cURL is a Linux utility, I downloaded a Windows build from here. Let's say I want to perform the following decompilation:
This is using the browser which works and produces a result. Now when trying to do the same using cURL from the command line, I get errors.
Output:
>curl --form "mode=raw" --form "input=code.bin" --form "architecture=powerpc" --form "endian=big" --form "raw_entry_point=0x0" --form "raw_section_vma=0x0" -u my-secret-api-key: "https://retdec.com/service/api/decompiler/decompilations" { "id": "yVWe4pe5", "links": { "decompilation": "https://retdec.com/service/api/decompiler/decompilations/yVWe4pe5", "status": "https://retdec.com/service/api/decompiler/decompilations/yVWe4pe5/status", "outputs": "https://retdec.com/service/api/decompiler/decompilations/yVWe4pe5/outputs" }}
{
"code": 400,
"description": "The input file is missing.",
"message": "Missing Input File"
}
curl: (3) [globbing] unmatched brace in column 1
curl: (6) Could not resolve host: id
curl: (6) Could not resolve host: yVWe4pe5,
curl: (6) Could not resolve host: links
curl: (3) [globbing] unmatched brace in column 1
curl: (6) Could not resolve host: decompilation
{
"code": 405,
"description": "The method is not allowed for the requested URL.",
"message": "Method Not Allowed"
}
curl: (6) Could not resolve host: status
{
"code": 404,
"description": "The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.",
"message": "Not Found"
}
curl: (6) Could not resolve host: outputs
{
"code": 405,
"description": "The method is not allowed for the requested URL.",
"message": "Method Not Allowed"
}
curl: (3) [globbing] unmatched close brace/bracket in column 1
Also yes, the code.bin is in the same directory as the command line (script). How can I make it work? I actually prefer a solution in Java and not cURL but doing it in cURL first might be easier for understanding since no Java examples or documentation is provided.
Nevermind, it's pretty straightforward.
Starting the process:
>curl --form "mode=raw" --form "input=#code.bin;filename=code.bin" --form "architecture=powerpc" --form "endian=big" --form "raw_entry_point=0x0" --form "raw_section_vma=0x0" --form "target_language=c" -u my-secret-api-key: "https://retdec.com/service/api/decompiler/decompilations"
Received (example) response:
{
"id": "mKgBoLa3jo",
"links": {
"decompilation": "https://retdec.com/service/api/decompiler/decompilations/mKgBoLa3jo",
"outputs": "https://retdec.com/service/api/decompiler/decompilations/mKgBoLa3jo/outputs",
"status": "https://retdec.com/service/api/decompiler/decompilations/mKgBoLa3jo/status"
}
}
Getting the decompiled (example) code:
>curl -u my-secret-api-key: https://retdec.com/service/api/decompiler/decompilations/r8OW7AaAOb/outputs/hll
//
// This file was generated by the Retargetable Decompiler
// Website: https://retdec.com
// Copyright (c) 2017 Retargetable Decompiler <info#retdec.com>
//
#include <stdint.h>
// ------------------- Function Prototypes --------------------
int32_t entry_point(int32_t a1);
int32_t unknown_20ca300(int32_t a1, int32_t a2);
int32_t unknown_212363c(int32_t a1);
int32_t unknown_27a2ad4(int32_t a1, int32_t a2);
// ------------------------ Functions -------------------------
// Address range: 0x0 - 0x1ef
int32_t entry_point(int32_t a1) {
int32_t result = a1; // r26
if (unknown_27a2ad4(a1, 0x27a2ad4) != 0) {
// 0x94
result = -1;
unknown_212363c(0);
unknown_20ca300(0, 0x830000);
// branch -> 0x54
}
// 0x54
return result;
}
// --------------------- Meta-Information ---------------------
// Detected compiler/packer: gcc (gcc-powerpc-elf) (4.5.1 - 4.5.2)
// Detected functions: 1
// Decompiler release: v2.2.1 (2016-09-07)
// Decompilation date: 2017-10-06 22:50:25
And so on.