• Post Reply Bookmark Topic Watch Topic
  • New Topic

Exception handling and setting flags  RSS feed

 
René Schmidt
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
.
 
Praful Thakare
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if both if statements are executed then mainUploadFailed is false . do you see this in error log? S3 putObject failed for ..?

you can print mainUploadFailed in both if like logger.info("Value of mainUploadFailed is "+mainUploadFailed);?
 
René Schmidt
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
.
 
Paweł Baczyński
Bartender
Posts: 2083
44
Firefox Browser IntelliJ IDE Java Linux Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
René Schmidt wrote:The exception catcher correctly catches the failure in the first try block.
René Schmidt wrote:As you can see... Java never sets mainUploadFailed =true !

Those sentences contradict each other.
 
Praful Thakare
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
exactly, so there is no exception raised in first if statement. to confirm replace first if with following code.

 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!