mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-24 03:57:06 -04:00
MediaService: Add MediaBackendError
This get's thrown when the backend can't perform the required action. Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
df1ae4d512
commit
8515d824b7
3 changed files with 11 additions and 0 deletions
|
@ -11,6 +11,7 @@ export interface MediaBackend {
|
|||
* Saves a file according to backend internals.
|
||||
* @param buffer File data
|
||||
* @param fileName Name of the file to save. Can include a file extension.
|
||||
* @throws {MediaBackendError} - there was an error saving the file
|
||||
* @return Tuple of file URL and internal backend data, which should be saved.
|
||||
*/
|
||||
saveFile(buffer: Buffer, fileName: string): Promise<[string, BackendData]>;
|
||||
|
@ -19,6 +20,7 @@ export interface MediaBackend {
|
|||
* Retrieve the URL of a previously saved file.
|
||||
* @param fileName String to identify the file
|
||||
* @param backendData Internal backend data
|
||||
* @throws {MediaBackendError} - there was an error deleting the file
|
||||
*/
|
||||
getFileURL(fileName: string, backendData: BackendData): Promise<string>;
|
||||
|
||||
|
@ -26,6 +28,7 @@ export interface MediaBackend {
|
|||
* Delete a file from the backend
|
||||
* @param fileName String to identify the file
|
||||
* @param backendData Internal backend data
|
||||
* @throws {MediaBackendError} - there was an error retrieving the url
|
||||
*/
|
||||
deleteFile(fileName: string, backendData: BackendData): Promise<void>;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue