Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/ObsAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ private function upload(string $path, $contents, Config $config): void
'Body' => $contents,
]));
} catch (ObsException $obsException) {
throw UnableToWriteFile::atLocation($path, '', $obsException);
throw UnableToWriteFile::atLocation($path, $obsException->getMessage(), $obsException);
}
}

Expand Down Expand Up @@ -223,7 +223,7 @@ public function delete(string $path): void
'Key' => $this->pathPrefixer->prefixPath($path),
]);
} catch (ObsException $obsException) {
throw UnableToDeleteFile::atLocation($path, '', $obsException);
throw UnableToDeleteFile::atLocation($path, $obsException->getMessage(), $obsException);
}
}

Expand All @@ -247,7 +247,7 @@ public function deleteDirectory(string $path): void
]);
}
} catch (ObsException $obsException) {
throw UnableToDeleteDirectory::atLocation($path, '', $obsException);
throw UnableToDeleteDirectory::atLocation($path, $obsException->getMessage(), $obsException);
}
}

Expand All @@ -274,7 +274,7 @@ public function setVisibility(string $path, string $visibility): void
'ACL' => $this->visibilityConverter->visibilityToAcl($visibility),
]);
} catch (ObsException $obsException) {
throw UnableToSetVisibility::atLocation($path, '', $obsException);
throw UnableToSetVisibility::atLocation($path, $obsException->getMessage(), $obsException);
}
}

Expand All @@ -288,7 +288,7 @@ public function visibility(string $path): FileAttributes
]
);
} catch (ObsException $obsException) {
throw UnableToRetrieveMetadata::visibility($path, '', $obsException);
throw UnableToRetrieveMetadata::visibility($path, $obsException->getMessage(), $obsException);
}

$visibility = $this->visibilityConverter->aclToVisibility((array) $result->get('Grants'));
Expand Down Expand Up @@ -376,7 +376,7 @@ private function getMetadata(string $path, string $type): FileAttributes
'Key' => $this->pathPrefixer->prefixPath($path),
]);
} catch (ObsException $obsException) {
throw UnableToRetrieveMetadata::create($path, $type, '', $obsException);
throw UnableToRetrieveMetadata::create($path, $type, $obsException->getMessage(), $obsException);
}

$attributes = $this->mapObjectMetadata($metadata->toArray(), $path);
Expand Down Expand Up @@ -476,7 +476,7 @@ protected function getObject(string $path): StreamInterface

return $model['Body'];
} catch (ObsException $obsException) {
throw UnableToReadFile::fromLocation($path, '', $obsException);
throw UnableToReadFile::fromLocation($path, $obsException->getMessage(), $obsException);
}
}

Expand Down