how to import com.amazonaws.util.Throwables.failure
I have in an awkward situation. I am trying to import com.amazonaws.util.Throwables.failure. I can autocomplete up to Throwables. But, I cannot find failure under Throwables. How can I import com.amazonaws.util.Throwables.failure?
I may have to define the dependency in build.gradle. But, don't know what I should define.
Thanks a lot for your advice.
add a comment |
I have in an awkward situation. I am trying to import com.amazonaws.util.Throwables.failure. I can autocomplete up to Throwables. But, I cannot find failure under Throwables. How can I import com.amazonaws.util.Throwables.failure?
I may have to define the dependency in build.gradle. But, don't know what I should define.
Thanks a lot for your advice.
failureis probably a method incom.amazonaws.util.Throwables. Could you check the source?
– Edric
Nov 20 '18 at 14:06
@Edric Thanks for the comment. What source should I check?
– JH Sean Kang
Nov 20 '18 at 14:08
Hi Aniruddh Parlhar, the reason why I rollbacked to the 1st version of this question is that "may have" is not actually the same as "need". The OP probably meant that he "might have" to define a dependency as in it is now a must to define the dependency, as compared to "need", which completely changes the meaning of the sentence.
– Edric
Nov 20 '18 at 14:14
add a comment |
I have in an awkward situation. I am trying to import com.amazonaws.util.Throwables.failure. I can autocomplete up to Throwables. But, I cannot find failure under Throwables. How can I import com.amazonaws.util.Throwables.failure?
I may have to define the dependency in build.gradle. But, don't know what I should define.
Thanks a lot for your advice.
I have in an awkward situation. I am trying to import com.amazonaws.util.Throwables.failure. I can autocomplete up to Throwables. But, I cannot find failure under Throwables. How can I import com.amazonaws.util.Throwables.failure?
I may have to define the dependency in build.gradle. But, don't know what I should define.
Thanks a lot for your advice.
edited Nov 20 '18 at 14:11
Edric
7,34553045
7,34553045
asked Nov 20 '18 at 14:03
JH Sean KangJH Sean Kang
329
329
failureis probably a method incom.amazonaws.util.Throwables. Could you check the source?
– Edric
Nov 20 '18 at 14:06
@Edric Thanks for the comment. What source should I check?
– JH Sean Kang
Nov 20 '18 at 14:08
Hi Aniruddh Parlhar, the reason why I rollbacked to the 1st version of this question is that "may have" is not actually the same as "need". The OP probably meant that he "might have" to define a dependency as in it is now a must to define the dependency, as compared to "need", which completely changes the meaning of the sentence.
– Edric
Nov 20 '18 at 14:14
add a comment |
failureis probably a method incom.amazonaws.util.Throwables. Could you check the source?
– Edric
Nov 20 '18 at 14:06
@Edric Thanks for the comment. What source should I check?
– JH Sean Kang
Nov 20 '18 at 14:08
Hi Aniruddh Parlhar, the reason why I rollbacked to the 1st version of this question is that "may have" is not actually the same as "need". The OP probably meant that he "might have" to define a dependency as in it is now a must to define the dependency, as compared to "need", which completely changes the meaning of the sentence.
– Edric
Nov 20 '18 at 14:14
failure is probably a method in com.amazonaws.util.Throwables. Could you check the source?– Edric
Nov 20 '18 at 14:06
failure is probably a method in com.amazonaws.util.Throwables. Could you check the source?– Edric
Nov 20 '18 at 14:06
@Edric Thanks for the comment. What source should I check?
– JH Sean Kang
Nov 20 '18 at 14:08
@Edric Thanks for the comment. What source should I check?
– JH Sean Kang
Nov 20 '18 at 14:08
Hi Aniruddh Parlhar, the reason why I rollbacked to the 1st version of this question is that "may have" is not actually the same as "need". The OP probably meant that he "might have" to define a dependency as in it is now a must to define the dependency, as compared to "need", which completely changes the meaning of the sentence.
– Edric
Nov 20 '18 at 14:14
Hi Aniruddh Parlhar, the reason why I rollbacked to the 1st version of this question is that "may have" is not actually the same as "need". The OP probably meant that he "might have" to define a dependency as in it is now a must to define the dependency, as compared to "need", which completely changes the meaning of the sentence.
– Edric
Nov 20 '18 at 14:14
add a comment |
1 Answer
1
active
oldest
votes
It appears that you're trying to import a method from a class. I don't think that's possible in Java, so what you have to do is to just import com.amazonaws.utils.Throwables and then access the failure method from the imported Throwables class:
import com.amazonaws.utils.Throwables;
// ...
// NOTE: This is dummy/sample/example code. Please implement your own version of whatever you're doing.
private void throwFailure() {
// blah blah blah
Throwables.failure(/* insert parameters here */);
// blah blah blah
}
My code isimport static com.amazonaws.utils.Throwables.failure. It seems allow me to import the method. Anyway I tried as you suggested with 'import static com.amazonaws.utils.Throwables', and createdthrowFailure. But Android Studio says that Throwables does not have the method offailure, but it does onlygetRootCause,values,valueOf
– JH Sean Kang
Nov 20 '18 at 14:28
I have got the meaning of your comment of "check the source'. I checked the code ofcom.amazonaws.utils.Throwables. Strangely it is different from the code I found in github. The code which my code reference, ofc, does not have the method of failure, but the github source code ofcom.amazonaws.utils.Throwablesdoes have the method.
– JH Sean Kang
Nov 20 '18 at 14:32
Note that thethrowFailurefunction is just dummy code. I'm not experienced with Amazon's AWS.
– Edric
Nov 20 '18 at 15:20
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%2f53394744%2fhow-to-import-com-amazonaws-util-throwables-failure%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
It appears that you're trying to import a method from a class. I don't think that's possible in Java, so what you have to do is to just import com.amazonaws.utils.Throwables and then access the failure method from the imported Throwables class:
import com.amazonaws.utils.Throwables;
// ...
// NOTE: This is dummy/sample/example code. Please implement your own version of whatever you're doing.
private void throwFailure() {
// blah blah blah
Throwables.failure(/* insert parameters here */);
// blah blah blah
}
My code isimport static com.amazonaws.utils.Throwables.failure. It seems allow me to import the method. Anyway I tried as you suggested with 'import static com.amazonaws.utils.Throwables', and createdthrowFailure. But Android Studio says that Throwables does not have the method offailure, but it does onlygetRootCause,values,valueOf
– JH Sean Kang
Nov 20 '18 at 14:28
I have got the meaning of your comment of "check the source'. I checked the code ofcom.amazonaws.utils.Throwables. Strangely it is different from the code I found in github. The code which my code reference, ofc, does not have the method of failure, but the github source code ofcom.amazonaws.utils.Throwablesdoes have the method.
– JH Sean Kang
Nov 20 '18 at 14:32
Note that thethrowFailurefunction is just dummy code. I'm not experienced with Amazon's AWS.
– Edric
Nov 20 '18 at 15:20
add a comment |
It appears that you're trying to import a method from a class. I don't think that's possible in Java, so what you have to do is to just import com.amazonaws.utils.Throwables and then access the failure method from the imported Throwables class:
import com.amazonaws.utils.Throwables;
// ...
// NOTE: This is dummy/sample/example code. Please implement your own version of whatever you're doing.
private void throwFailure() {
// blah blah blah
Throwables.failure(/* insert parameters here */);
// blah blah blah
}
My code isimport static com.amazonaws.utils.Throwables.failure. It seems allow me to import the method. Anyway I tried as you suggested with 'import static com.amazonaws.utils.Throwables', and createdthrowFailure. But Android Studio says that Throwables does not have the method offailure, but it does onlygetRootCause,values,valueOf
– JH Sean Kang
Nov 20 '18 at 14:28
I have got the meaning of your comment of "check the source'. I checked the code ofcom.amazonaws.utils.Throwables. Strangely it is different from the code I found in github. The code which my code reference, ofc, does not have the method of failure, but the github source code ofcom.amazonaws.utils.Throwablesdoes have the method.
– JH Sean Kang
Nov 20 '18 at 14:32
Note that thethrowFailurefunction is just dummy code. I'm not experienced with Amazon's AWS.
– Edric
Nov 20 '18 at 15:20
add a comment |
It appears that you're trying to import a method from a class. I don't think that's possible in Java, so what you have to do is to just import com.amazonaws.utils.Throwables and then access the failure method from the imported Throwables class:
import com.amazonaws.utils.Throwables;
// ...
// NOTE: This is dummy/sample/example code. Please implement your own version of whatever you're doing.
private void throwFailure() {
// blah blah blah
Throwables.failure(/* insert parameters here */);
// blah blah blah
}
It appears that you're trying to import a method from a class. I don't think that's possible in Java, so what you have to do is to just import com.amazonaws.utils.Throwables and then access the failure method from the imported Throwables class:
import com.amazonaws.utils.Throwables;
// ...
// NOTE: This is dummy/sample/example code. Please implement your own version of whatever you're doing.
private void throwFailure() {
// blah blah blah
Throwables.failure(/* insert parameters here */);
// blah blah blah
}
edited Nov 20 '18 at 15:21
answered Nov 20 '18 at 14:17
EdricEdric
7,34553045
7,34553045
My code isimport static com.amazonaws.utils.Throwables.failure. It seems allow me to import the method. Anyway I tried as you suggested with 'import static com.amazonaws.utils.Throwables', and createdthrowFailure. But Android Studio says that Throwables does not have the method offailure, but it does onlygetRootCause,values,valueOf
– JH Sean Kang
Nov 20 '18 at 14:28
I have got the meaning of your comment of "check the source'. I checked the code ofcom.amazonaws.utils.Throwables. Strangely it is different from the code I found in github. The code which my code reference, ofc, does not have the method of failure, but the github source code ofcom.amazonaws.utils.Throwablesdoes have the method.
– JH Sean Kang
Nov 20 '18 at 14:32
Note that thethrowFailurefunction is just dummy code. I'm not experienced with Amazon's AWS.
– Edric
Nov 20 '18 at 15:20
add a comment |
My code isimport static com.amazonaws.utils.Throwables.failure. It seems allow me to import the method. Anyway I tried as you suggested with 'import static com.amazonaws.utils.Throwables', and createdthrowFailure. But Android Studio says that Throwables does not have the method offailure, but it does onlygetRootCause,values,valueOf
– JH Sean Kang
Nov 20 '18 at 14:28
I have got the meaning of your comment of "check the source'. I checked the code ofcom.amazonaws.utils.Throwables. Strangely it is different from the code I found in github. The code which my code reference, ofc, does not have the method of failure, but the github source code ofcom.amazonaws.utils.Throwablesdoes have the method.
– JH Sean Kang
Nov 20 '18 at 14:32
Note that thethrowFailurefunction is just dummy code. I'm not experienced with Amazon's AWS.
– Edric
Nov 20 '18 at 15:20
My code is
import static com.amazonaws.utils.Throwables.failure. It seems allow me to import the method. Anyway I tried as you suggested with 'import static com.amazonaws.utils.Throwables', and created throwFailure. But Android Studio says that Throwables does not have the method of failure, but it does only getRootCause, values, valueOf– JH Sean Kang
Nov 20 '18 at 14:28
My code is
import static com.amazonaws.utils.Throwables.failure. It seems allow me to import the method. Anyway I tried as you suggested with 'import static com.amazonaws.utils.Throwables', and created throwFailure. But Android Studio says that Throwables does not have the method of failure, but it does only getRootCause, values, valueOf– JH Sean Kang
Nov 20 '18 at 14:28
I have got the meaning of your comment of "check the source'. I checked the code of
com.amazonaws.utils.Throwables. Strangely it is different from the code I found in github. The code which my code reference, ofc, does not have the method of failure, but the github source code of com.amazonaws.utils.Throwables does have the method.– JH Sean Kang
Nov 20 '18 at 14:32
I have got the meaning of your comment of "check the source'. I checked the code of
com.amazonaws.utils.Throwables. Strangely it is different from the code I found in github. The code which my code reference, ofc, does not have the method of failure, but the github source code of com.amazonaws.utils.Throwables does have the method.– JH Sean Kang
Nov 20 '18 at 14:32
Note that the
throwFailure function is just dummy code. I'm not experienced with Amazon's AWS.– Edric
Nov 20 '18 at 15:20
Note that the
throwFailure function is just dummy code. I'm not experienced with Amazon's AWS.– Edric
Nov 20 '18 at 15:20
add a comment |
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%2f53394744%2fhow-to-import-com-amazonaws-util-throwables-failure%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
failureis probably a method incom.amazonaws.util.Throwables. Could you check the source?– Edric
Nov 20 '18 at 14:06
@Edric Thanks for the comment. What source should I check?
– JH Sean Kang
Nov 20 '18 at 14:08
Hi Aniruddh Parlhar, the reason why I rollbacked to the 1st version of this question is that "may have" is not actually the same as "need". The OP probably meant that he "might have" to define a dependency as in it is now a must to define the dependency, as compared to "need", which completely changes the meaning of the sentence.
– Edric
Nov 20 '18 at 14:14