Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No response with a non existing ID #54

Closed
cscetbon opened this issue Jul 9, 2021 · 3 comments
Closed

No response with a non existing ID #54

cscetbon opened this issue Jul 9, 2021 · 3 comments
Labels

Comments

@cscetbon
Copy link

cscetbon commented Jul 9, 2021

When an unknown ID is used imposter says it can't find it

14:59:28 ERROR i.g.i.p.s.SfdcPluginImpl - Account SObject with ID: 0015000000VALDtBBB not found

but it doesn't send a correct response to ForceApi and I get

Exception in thread "main" java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:488)
	at Main_Scriptlet_fc96736f82df81e8$Companion.main(Main_Scriptlet_fc96736f82df81e8.kt:6)
	at Main_Scriptlet_fc96736f82df81e8.main(Main_Scriptlet_fc96736f82df81e8.kt)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at org.jetbrains.kotlin.runner.AbstractRunner.run(runners.kt:64)
	at org.jetbrains.kotlin.runner.Main.run(Main.kt:176)
	at org.jetbrains.kotlin.runner.Main.main(Main.kt:186)
Caused by: java.lang.RuntimeException: java.io.IOException: Stream closed
	at com.force.api.http.Http.send(Http.java:118)
	at com.force.api.ForceApi.apiRequest(ForceApi.java:499)
	at com.force.api.ForceApi.getSObject(ForceApi.java:206)
	at Scriptlet_fc96736f82df81e8.<init>(scriptlet.fc96736f82df81e8.kts:25)
	... 13 more
Caused by: java.io.IOException: Stream closed
	at java.base/java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:165)
	at java.base/java.io.BufferedInputStream.read1(BufferedInputStream.java:290)
	at java.base/java.io.BufferedInputStream.read(BufferedInputStream.java:351)
	at java.base/java.io.FilterInputStream.read(FilterInputStream.java:107)
	at com.force.api.http.Http.readResponse(Http.java:57)
	at com.force.api.http.Http.send(Http.java:113)
	... 16 more
@outofcoffee
Copy link
Owner

Hi @cscetbon - it looks like Imposter sending the HTTP 404 status code might not be correct.

From the documentation, it appears a response like this might be appropriate:

[
{
  "message" : "The requested resource does not exist",
  "errorCode" : "NOT_FOUND"
}
]

A few questions:

  1. does this look correct to you?
  2. what HTTP status code would you expect to be paired with this response body?

@outofcoffee outofcoffee added the bug label Nov 2, 2021
@outofcoffee
Copy link
Owner

outofcoffee commented Nov 2, 2021

Also, for reference - this is the ForceApi library implementation... notice their comment 😬

Screenshot 2021-11-02 at 20 11 32

@cscetbon
Copy link
Author

cscetbon commented Nov 7, 2021

hmm so it's coming from their API 🤔

@outofcoffee outofcoffee removed the bug label Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants