Storage: internal error getter (#806)

* Storage: internal error getter

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
SG 2021-11-04 20:46:45 +10:00 committed by GitHub
parent 7f94ef3179
commit bb9c464a13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -324,6 +324,11 @@ FS_Error storage_file_get_error(File* file) {
return file->error_id;
}
int32_t storage_file_get_internal_error(File* file) {
furi_check(file != NULL);
return file->internal_error_id;
}
const char* storage_file_get_error_desc(File* file) {
furi_check(file != NULL);
return filesystem_api_error_get_desc(file->error_id);

View File

@ -197,6 +197,12 @@ const char* storage_error_get_desc(FS_Error error_id);
*/
FS_Error storage_file_get_error(File* file);
/** Retrieves the internal (storage-specific) error id from the file object
* @param file pointer to file object. Pointer must not point to NULL. YOU CANNOT RETREIVE THE INTERNAL ERROR ID IF THE FILE HAS BEEN CLOSED
* @return FS_Error error id
*/
int32_t storage_file_get_internal_error(File* file);
/** Retrieves the error text from the file object
* @param file pointer to file object. Pointer must not point to NULL. YOU CANNOT RETREIVE THE ERROR TEXT IF THE FILE HAS BEEN CLOSED
* @return const char* error text