Using Optional for getSingleResultWhat is a raw type and why shouldn't we use it?Java optional parametersUses for OptionalWhat is an optional value in Swift?Why create “Implicitly Unwrapped Optionals”, since that implies you know there's a value?Should Java 8 getters return optional type?Why should Java 8's Optional not be used in argumentsWhat does “fatal error: unexpectedly found nil while unwrapping an Optional value” mean?JEE, eclipselink, glassfish4.0 can't persist entityWebService - could not initialize proxy - no SessionEnvers query - return REVTYPE along with modified fields
Examples of machine learning applied to operations research?
Will Jimmy fall off his platform?
Uniform initialization by tuple
Intern not wearing safety equipment; how could I have handled this differently?
What are some bad ways to subvert tropes?
Chilling juice in copper vessel
Is conquering your neighbors to fight a greater enemy a valid strategy?
What does the multimeter dial do internally?
Possibility to correct pitch from digital versions of records with the hole not centered
Why SQL does not use the indexed view?
What does "spinning upon the shoals" mean?
QR codes, do people use them?
What do you call a situation where you have choices but no good choice?
What was the significance of Spider-Man: Far From Home being an MCU Phase 3 film instead of a Phase 4 film?
Ways to demonstrate ("show-off") contributions as an undergraduate in research
Examples of fluid (including air) being used to transmit digital data?
Interpretation of non-significant results as "trends"
Sense of humor in your sci-fi stories
How do ballistic trajectories work in a ring world?
Wouldn't putting an electronic key inside a small Faraday cage render it completely useless?
How was the website able to tell my credit card was wrong before it processed it?
Gory anime with pink haired girl escaping an asylum
Can we share mixing jug/beaker for developer, fixer and stop bath?
Why does "mi piace" mean "I like" instead of "he/she/it likes me"?
Using Optional for getSingleResult
What is a raw type and why shouldn't we use it?Java optional parametersUses for OptionalWhat is an optional value in Swift?Why create “Implicitly Unwrapped Optionals”, since that implies you know there's a value?Should Java 8 getters return optional type?Why should Java 8's Optional not be used in argumentsWhat does “fatal error: unexpectedly found nil while unwrapping an Optional value” mean?JEE, eclipselink, glassfish4.0 can't persist entityWebService - could not initialize proxy - no SessionEnvers query - return REVTYPE along with modified fields
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
Hello I have a question about Optional.
Optional should be used when there is possibility then null can be returned.
I wanted to use it to find the image by item id.
So in DAO:
@Override
public Optional findImage(int itemId)
Session currentSession = entityManager.unwrap(Session.class);
return currentSession
.createQuery("select from Image as i where it.itemId=:itemId")
.setParameter("itemId", itemId)
.setMaxResults(1)
.getResultList()
.stream()
.findFirst();
In service:
@Override
public Image findImage(int itemId)
LOGGER.info("Getting image by item id: ", itemId);
Optional opt = this.imageDAO.findImage(itemId);
return opt.orElseThrow(() -> new ImageNotFound("The image for item with id: " + itemId + " was not found"));
But I can not get the value or throw the specific error.
Can anybody explain how I should approach the getting single result via Optional?
Thanks!!
java spring hibernate optional
|
show 4 more comments
Hello I have a question about Optional.
Optional should be used when there is possibility then null can be returned.
I wanted to use it to find the image by item id.
So in DAO:
@Override
public Optional findImage(int itemId)
Session currentSession = entityManager.unwrap(Session.class);
return currentSession
.createQuery("select from Image as i where it.itemId=:itemId")
.setParameter("itemId", itemId)
.setMaxResults(1)
.getResultList()
.stream()
.findFirst();
In service:
@Override
public Image findImage(int itemId)
LOGGER.info("Getting image by item id: ", itemId);
Optional opt = this.imageDAO.findImage(itemId);
return opt.orElseThrow(() -> new ImageNotFound("The image for item with id: " + itemId + " was not found"));
But I can not get the value or throw the specific error.
Can anybody explain how I should approach the getting single result via Optional?
Thanks!!
java spring hibernate optional
2
Check the syntax of the query , sounds like some thing is missing here. Tryselect i from Image as it where it.itemId=:itemId
– Gopi
Mar 25 at 21:12
2
"I can not get the value or throw the specific error". Clarify.
– LppEdd
Mar 25 at 21:13
2
You're the third one I see today unwrapping the EntityManager to use the Hibernate proprietary Session. Why are you doing that? What's the point, except making your code awkward and not portable? You can execute queries using the EntityManager directly. No need to unwrap.
– JB Nizet
Mar 25 at 21:15
1
Are you asking what you can do with an Optional? The javadoc is your friend: docs.oracle.com/javase/8/docs/api/java/util/Optional.html. If not, then once again, clarify: what do you want to achieve, precisely?
– JB Nizet
Mar 25 at 21:28
2
Assuming you're usingjava.util.Optional
, you are returning the raw type. This means all the methods that return the wrapped value returnObject
. You should declare the return type asOptional<Image>
. If that's not your problem (or really even if it is) you should edit your question to add clarification. Describe what you're trying to do, what's actually happening, and include the exact error(s) you're getting. See minimal reproducible example and How to Ask.
– Slaw
Mar 25 at 21:42
|
show 4 more comments
Hello I have a question about Optional.
Optional should be used when there is possibility then null can be returned.
I wanted to use it to find the image by item id.
So in DAO:
@Override
public Optional findImage(int itemId)
Session currentSession = entityManager.unwrap(Session.class);
return currentSession
.createQuery("select from Image as i where it.itemId=:itemId")
.setParameter("itemId", itemId)
.setMaxResults(1)
.getResultList()
.stream()
.findFirst();
In service:
@Override
public Image findImage(int itemId)
LOGGER.info("Getting image by item id: ", itemId);
Optional opt = this.imageDAO.findImage(itemId);
return opt.orElseThrow(() -> new ImageNotFound("The image for item with id: " + itemId + " was not found"));
But I can not get the value or throw the specific error.
Can anybody explain how I should approach the getting single result via Optional?
Thanks!!
java spring hibernate optional
Hello I have a question about Optional.
Optional should be used when there is possibility then null can be returned.
I wanted to use it to find the image by item id.
So in DAO:
@Override
public Optional findImage(int itemId)
Session currentSession = entityManager.unwrap(Session.class);
return currentSession
.createQuery("select from Image as i where it.itemId=:itemId")
.setParameter("itemId", itemId)
.setMaxResults(1)
.getResultList()
.stream()
.findFirst();
In service:
@Override
public Image findImage(int itemId)
LOGGER.info("Getting image by item id: ", itemId);
Optional opt = this.imageDAO.findImage(itemId);
return opt.orElseThrow(() -> new ImageNotFound("The image for item with id: " + itemId + " was not found"));
But I can not get the value or throw the specific error.
Can anybody explain how I should approach the getting single result via Optional?
Thanks!!
java spring hibernate optional
java spring hibernate optional
asked Mar 25 at 21:09
ErnestoErnesto
17715 bronze badges
17715 bronze badges
2
Check the syntax of the query , sounds like some thing is missing here. Tryselect i from Image as it where it.itemId=:itemId
– Gopi
Mar 25 at 21:12
2
"I can not get the value or throw the specific error". Clarify.
– LppEdd
Mar 25 at 21:13
2
You're the third one I see today unwrapping the EntityManager to use the Hibernate proprietary Session. Why are you doing that? What's the point, except making your code awkward and not portable? You can execute queries using the EntityManager directly. No need to unwrap.
– JB Nizet
Mar 25 at 21:15
1
Are you asking what you can do with an Optional? The javadoc is your friend: docs.oracle.com/javase/8/docs/api/java/util/Optional.html. If not, then once again, clarify: what do you want to achieve, precisely?
– JB Nizet
Mar 25 at 21:28
2
Assuming you're usingjava.util.Optional
, you are returning the raw type. This means all the methods that return the wrapped value returnObject
. You should declare the return type asOptional<Image>
. If that's not your problem (or really even if it is) you should edit your question to add clarification. Describe what you're trying to do, what's actually happening, and include the exact error(s) you're getting. See minimal reproducible example and How to Ask.
– Slaw
Mar 25 at 21:42
|
show 4 more comments
2
Check the syntax of the query , sounds like some thing is missing here. Tryselect i from Image as it where it.itemId=:itemId
– Gopi
Mar 25 at 21:12
2
"I can not get the value or throw the specific error". Clarify.
– LppEdd
Mar 25 at 21:13
2
You're the third one I see today unwrapping the EntityManager to use the Hibernate proprietary Session. Why are you doing that? What's the point, except making your code awkward and not portable? You can execute queries using the EntityManager directly. No need to unwrap.
– JB Nizet
Mar 25 at 21:15
1
Are you asking what you can do with an Optional? The javadoc is your friend: docs.oracle.com/javase/8/docs/api/java/util/Optional.html. If not, then once again, clarify: what do you want to achieve, precisely?
– JB Nizet
Mar 25 at 21:28
2
Assuming you're usingjava.util.Optional
, you are returning the raw type. This means all the methods that return the wrapped value returnObject
. You should declare the return type asOptional<Image>
. If that's not your problem (or really even if it is) you should edit your question to add clarification. Describe what you're trying to do, what's actually happening, and include the exact error(s) you're getting. See minimal reproducible example and How to Ask.
– Slaw
Mar 25 at 21:42
2
2
Check the syntax of the query , sounds like some thing is missing here. Try
select i from Image as it where it.itemId=:itemId
– Gopi
Mar 25 at 21:12
Check the syntax of the query , sounds like some thing is missing here. Try
select i from Image as it where it.itemId=:itemId
– Gopi
Mar 25 at 21:12
2
2
"I can not get the value or throw the specific error". Clarify.
– LppEdd
Mar 25 at 21:13
"I can not get the value or throw the specific error". Clarify.
– LppEdd
Mar 25 at 21:13
2
2
You're the third one I see today unwrapping the EntityManager to use the Hibernate proprietary Session. Why are you doing that? What's the point, except making your code awkward and not portable? You can execute queries using the EntityManager directly. No need to unwrap.
– JB Nizet
Mar 25 at 21:15
You're the third one I see today unwrapping the EntityManager to use the Hibernate proprietary Session. Why are you doing that? What's the point, except making your code awkward and not portable? You can execute queries using the EntityManager directly. No need to unwrap.
– JB Nizet
Mar 25 at 21:15
1
1
Are you asking what you can do with an Optional? The javadoc is your friend: docs.oracle.com/javase/8/docs/api/java/util/Optional.html. If not, then once again, clarify: what do you want to achieve, precisely?
– JB Nizet
Mar 25 at 21:28
Are you asking what you can do with an Optional? The javadoc is your friend: docs.oracle.com/javase/8/docs/api/java/util/Optional.html. If not, then once again, clarify: what do you want to achieve, precisely?
– JB Nizet
Mar 25 at 21:28
2
2
Assuming you're using
java.util.Optional
, you are returning the raw type. This means all the methods that return the wrapped value return Object
. You should declare the return type as Optional<Image>
. If that's not your problem (or really even if it is) you should edit your question to add clarification. Describe what you're trying to do, what's actually happening, and include the exact error(s) you're getting. See minimal reproducible example and How to Ask.– Slaw
Mar 25 at 21:42
Assuming you're using
java.util.Optional
, you are returning the raw type. This means all the methods that return the wrapped value return Object
. You should declare the return type as Optional<Image>
. If that's not your problem (or really even if it is) you should edit your question to add clarification. Describe what you're trying to do, what's actually happening, and include the exact error(s) you're getting. See minimal reproducible example and How to Ask.– Slaw
Mar 25 at 21:42
|
show 4 more comments
1 Answer
1
active
oldest
votes
EDIT
As mentioned by @Slaw, my previous answer was incorrect and I have assumed that the code posted in the question has no compilation issue. Anyway, here's the updated answer based on the @Slaw's comment.
Basically the code wouldn't compile because it's unable to infer the type of Optional to return. So just parameterize Optional
@Override
public Image findImage(int itemId)
LOGGER.info("Getting image by item id: ", itemId);
Optional<Image> opt = this.imageDAO.findImage(itemId); <== parameterize Optional
return opt.orElseThrow(() -> new ImageNotFound("The image for item with id: " + itemId + " was not found"));
How is this correct? No matter whatOptional
the OP is using (java.util.Optional
or some other), your solution assumes the wrapped value, returned byget
, has anorElseThrow
method. Why would it? And assuming we're usingjava.util.Optional
, theorElseThrow
method will return the value if present, otherwise it will throw the exception returned by the supplier. Theget
method will throw aNoSuchElementException
if no value is present. And you're still using the raw type, soget
andorElseThrow
returnObject
, notImage
, and this should still fail to compile.
– Slaw
Mar 27 at 15:57
You are absolutely correct. I was under the assumption that the code provided in the question would already compile. A mistake on my side. You should provide your answer instead, or I will edit mine to reflect your point. Should have verified my answer properly!
– Tan Kim Loong
Mar 28 at 3:13
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55346441%2fusing-optional-for-getsingleresult%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
EDIT
As mentioned by @Slaw, my previous answer was incorrect and I have assumed that the code posted in the question has no compilation issue. Anyway, here's the updated answer based on the @Slaw's comment.
Basically the code wouldn't compile because it's unable to infer the type of Optional to return. So just parameterize Optional
@Override
public Image findImage(int itemId)
LOGGER.info("Getting image by item id: ", itemId);
Optional<Image> opt = this.imageDAO.findImage(itemId); <== parameterize Optional
return opt.orElseThrow(() -> new ImageNotFound("The image for item with id: " + itemId + " was not found"));
How is this correct? No matter whatOptional
the OP is using (java.util.Optional
or some other), your solution assumes the wrapped value, returned byget
, has anorElseThrow
method. Why would it? And assuming we're usingjava.util.Optional
, theorElseThrow
method will return the value if present, otherwise it will throw the exception returned by the supplier. Theget
method will throw aNoSuchElementException
if no value is present. And you're still using the raw type, soget
andorElseThrow
returnObject
, notImage
, and this should still fail to compile.
– Slaw
Mar 27 at 15:57
You are absolutely correct. I was under the assumption that the code provided in the question would already compile. A mistake on my side. You should provide your answer instead, or I will edit mine to reflect your point. Should have verified my answer properly!
– Tan Kim Loong
Mar 28 at 3:13
add a comment |
EDIT
As mentioned by @Slaw, my previous answer was incorrect and I have assumed that the code posted in the question has no compilation issue. Anyway, here's the updated answer based on the @Slaw's comment.
Basically the code wouldn't compile because it's unable to infer the type of Optional to return. So just parameterize Optional
@Override
public Image findImage(int itemId)
LOGGER.info("Getting image by item id: ", itemId);
Optional<Image> opt = this.imageDAO.findImage(itemId); <== parameterize Optional
return opt.orElseThrow(() -> new ImageNotFound("The image for item with id: " + itemId + " was not found"));
How is this correct? No matter whatOptional
the OP is using (java.util.Optional
or some other), your solution assumes the wrapped value, returned byget
, has anorElseThrow
method. Why would it? And assuming we're usingjava.util.Optional
, theorElseThrow
method will return the value if present, otherwise it will throw the exception returned by the supplier. Theget
method will throw aNoSuchElementException
if no value is present. And you're still using the raw type, soget
andorElseThrow
returnObject
, notImage
, and this should still fail to compile.
– Slaw
Mar 27 at 15:57
You are absolutely correct. I was under the assumption that the code provided in the question would already compile. A mistake on my side. You should provide your answer instead, or I will edit mine to reflect your point. Should have verified my answer properly!
– Tan Kim Loong
Mar 28 at 3:13
add a comment |
EDIT
As mentioned by @Slaw, my previous answer was incorrect and I have assumed that the code posted in the question has no compilation issue. Anyway, here's the updated answer based on the @Slaw's comment.
Basically the code wouldn't compile because it's unable to infer the type of Optional to return. So just parameterize Optional
@Override
public Image findImage(int itemId)
LOGGER.info("Getting image by item id: ", itemId);
Optional<Image> opt = this.imageDAO.findImage(itemId); <== parameterize Optional
return opt.orElseThrow(() -> new ImageNotFound("The image for item with id: " + itemId + " was not found"));
EDIT
As mentioned by @Slaw, my previous answer was incorrect and I have assumed that the code posted in the question has no compilation issue. Anyway, here's the updated answer based on the @Slaw's comment.
Basically the code wouldn't compile because it's unable to infer the type of Optional to return. So just parameterize Optional
@Override
public Image findImage(int itemId)
LOGGER.info("Getting image by item id: ", itemId);
Optional<Image> opt = this.imageDAO.findImage(itemId); <== parameterize Optional
return opt.orElseThrow(() -> new ImageNotFound("The image for item with id: " + itemId + " was not found"));
edited Mar 29 at 17:04
answered Mar 26 at 6:40
Tan Kim LoongTan Kim Loong
6115 silver badges12 bronze badges
6115 silver badges12 bronze badges
How is this correct? No matter whatOptional
the OP is using (java.util.Optional
or some other), your solution assumes the wrapped value, returned byget
, has anorElseThrow
method. Why would it? And assuming we're usingjava.util.Optional
, theorElseThrow
method will return the value if present, otherwise it will throw the exception returned by the supplier. Theget
method will throw aNoSuchElementException
if no value is present. And you're still using the raw type, soget
andorElseThrow
returnObject
, notImage
, and this should still fail to compile.
– Slaw
Mar 27 at 15:57
You are absolutely correct. I was under the assumption that the code provided in the question would already compile. A mistake on my side. You should provide your answer instead, or I will edit mine to reflect your point. Should have verified my answer properly!
– Tan Kim Loong
Mar 28 at 3:13
add a comment |
How is this correct? No matter whatOptional
the OP is using (java.util.Optional
or some other), your solution assumes the wrapped value, returned byget
, has anorElseThrow
method. Why would it? And assuming we're usingjava.util.Optional
, theorElseThrow
method will return the value if present, otherwise it will throw the exception returned by the supplier. Theget
method will throw aNoSuchElementException
if no value is present. And you're still using the raw type, soget
andorElseThrow
returnObject
, notImage
, and this should still fail to compile.
– Slaw
Mar 27 at 15:57
You are absolutely correct. I was under the assumption that the code provided in the question would already compile. A mistake on my side. You should provide your answer instead, or I will edit mine to reflect your point. Should have verified my answer properly!
– Tan Kim Loong
Mar 28 at 3:13
How is this correct? No matter what
Optional
the OP is using (java.util.Optional
or some other), your solution assumes the wrapped value, returned by get
, has an orElseThrow
method. Why would it? And assuming we're using java.util.Optional
, the orElseThrow
method will return the value if present, otherwise it will throw the exception returned by the supplier. The get
method will throw a NoSuchElementException
if no value is present. And you're still using the raw type, so get
and orElseThrow
return Object
, not Image
, and this should still fail to compile.– Slaw
Mar 27 at 15:57
How is this correct? No matter what
Optional
the OP is using (java.util.Optional
or some other), your solution assumes the wrapped value, returned by get
, has an orElseThrow
method. Why would it? And assuming we're using java.util.Optional
, the orElseThrow
method will return the value if present, otherwise it will throw the exception returned by the supplier. The get
method will throw a NoSuchElementException
if no value is present. And you're still using the raw type, so get
and orElseThrow
return Object
, not Image
, and this should still fail to compile.– Slaw
Mar 27 at 15:57
You are absolutely correct. I was under the assumption that the code provided in the question would already compile. A mistake on my side. You should provide your answer instead, or I will edit mine to reflect your point. Should have verified my answer properly!
– Tan Kim Loong
Mar 28 at 3:13
You are absolutely correct. I was under the assumption that the code provided in the question would already compile. A mistake on my side. You should provide your answer instead, or I will edit mine to reflect your point. Should have verified my answer properly!
– Tan Kim Loong
Mar 28 at 3:13
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55346441%2fusing-optional-for-getsingleresult%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
Check the syntax of the query , sounds like some thing is missing here. Try
select i from Image as it where it.itemId=:itemId
– Gopi
Mar 25 at 21:12
2
"I can not get the value or throw the specific error". Clarify.
– LppEdd
Mar 25 at 21:13
2
You're the third one I see today unwrapping the EntityManager to use the Hibernate proprietary Session. Why are you doing that? What's the point, except making your code awkward and not portable? You can execute queries using the EntityManager directly. No need to unwrap.
– JB Nizet
Mar 25 at 21:15
1
Are you asking what you can do with an Optional? The javadoc is your friend: docs.oracle.com/javase/8/docs/api/java/util/Optional.html. If not, then once again, clarify: what do you want to achieve, precisely?
– JB Nizet
Mar 25 at 21:28
2
Assuming you're using
java.util.Optional
, you are returning the raw type. This means all the methods that return the wrapped value returnObject
. You should declare the return type asOptional<Image>
. If that's not your problem (or really even if it is) you should edit your question to add clarification. Describe what you're trying to do, what's actually happening, and include the exact error(s) you're getting. See minimal reproducible example and How to Ask.– Slaw
Mar 25 at 21:42