Skip to content

Conversation

@harshavardhana
Copy link
Member

No description provided.

except ResponseError as err:
pass
if err.code != 'XMinioInvalidObjectName':
raise Exception(err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks ugly to wrap an exception with Exception which is unnecessary. I see this is used all over the code.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I kept it as it is.. will need to change comprehensively later.

finally:
try:
client.remove_object(bucket_name, object_name)
try:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are 2 try blocks back to back.
First try block is unnecessary.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need it... otherwise, we will crash. Look at the original issue why this fix is necessary. #5954

poornas
poornas previously requested changes Jun 4, 2018
else:
pass
except Exception as err:
raise Exception(err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@harshavardhana , lines 635 and 636 can be removed -since these 2 lines are just re-raising the exception, which would have happened anyway.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not able to understand... how would that happen?

raise Exception(err)
else:
pass
except Exception as err:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lines 646,647 can be removed -since they are just re-raising the exception that would have been raised even without these statements.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not able to understand... how would that happen?

@harshavardhana harshavardhana merged commit fd92f68 into minio:master Jun 8, 2018
@harshavardhana harshavardhana deleted the avoid-object branch June 8, 2018 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants