You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use SetObjectTagsAsync method to update tags on object in my minio bucket.
Sadly, this method doesn't inform if anything went wrong while doing so. As I understood while reading source, it is related to errors which are generated by 404 status code from minio.
I'm using Minio .net sdk. Package version is 6.0.3. Latest at the time of submitting an issue.
The problem is the following:
While I'm trying to update object tags, none of the errors related to 404 code throw an exception. The task, returned by SetObjectTagsAsync always finished successfully.
My example is provided below.
When calling SetObjectTagsAsync SDK calls the following method chain: SetObjectTagsAsync -> ExecuteTaskAsync -> ExecuteTaskCoreAsync. Inside ExecuteTaskCoreAsync response returns unsuccessful status code (check first screenshot below). At this example the real error was absence of the object in a bucket, so minio client return 404 code and it is correct.
But as you can see on the second screenshot my method (called by SetObjectTagsAsync) was PUT, so it doesn't go into any existing if condition branch or HandleIfErrorResponse method to throw an exception and simply returns responseResult containing error in an xml format: <?xml version="1.0" encoding="UTF-8"?> <Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Key>{any non existing Guid}</Key><BucketName>{bucket name}</BucketName><Resource>/{bucket name}/{any non existing Guid}</Resource>here go request and host id... </Error>
It also would be fine for me to manually inspect the ResponseResult to check if there was some error in it, cause it is returned by both ExecuteTaskCoreAsync and ExecuteTaskAsync methods in a chain, but sadly SetObjectTagsAsync doesn't return it back to the consumer, it just return task, even though it has the response after awaiting ExecuteTaskAsync (check screenshot №3)
IMHO a quick workaround for giving a client the ability to manually determine if there was in error in his request would be changing the return value from Task to Task<ResponseResult> in the signature of SetObjectTagsAsync method.
The text was updated successfully, but these errors were encountered:
As a workaround for now before trying to update object tags I call StatObjectAsync first.
This method correctly throws ObjectNotFoundException and it fits for me
I'm trying to use SetObjectTagsAsync method to update tags on object in my minio bucket.
Sadly, this method doesn't inform if anything went wrong while doing so. As I understood while reading source, it is related to errors which are generated by 404 status code from minio.
I'm using Minio .net sdk. Package version is 6.0.3. Latest at the time of submitting an issue.
The problem is the following:
While I'm trying to update object tags, none of the errors related to 404 code throw an exception. The task, returned by
SetObjectTagsAsync
always finished successfully.My example is provided below.
When calling
SetObjectTagsAsync
SDK calls the following method chain:SetObjectTagsAsync -> ExecuteTaskAsync -> ExecuteTaskCoreAsync
. InsideExecuteTaskCoreAsync
response returns unsuccessful status code (check first screenshot below). At this example the real error was absence of the object in a bucket, so minio client return 404 code and it is correct.But as you can see on the second screenshot my method (called by
SetObjectTagsAsync
) was PUT, so it doesn't go into any existing if condition branch orHandleIfErrorResponse
method to throw an exception and simply returns responseResult containing error in an xml format:<?xml version="1.0" encoding="UTF-8"?> <Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Key>{any non existing Guid}</Key><BucketName>{bucket name}</BucketName><Resource>/{bucket name}/{any non existing Guid}</Resource>here go request and host id... </Error>
It also would be fine for me to manually inspect the
ResponseResult
to check if there was some error in it, cause it is returned by bothExecuteTaskCoreAsync
andExecuteTaskAsync
methods in a chain, but sadlySetObjectTagsAsync
doesn't return it back to the consumer, it just return task, even though it has the response after awaitingExecuteTaskAsync
(check screenshot №3)IMHO a quick workaround for giving a client the ability to manually determine if there was in error in his request would be changing the return value from
Task
toTask<ResponseResult>
in the signature ofSetObjectTagsAsync
method.The text was updated successfully, but these errors were encountered: