Skip to content

Commit cf6a5cc

Browse files
committed
Refactor error code handling by restructuring error code extensions
- Removed old error code extension files for auth, local database, platform, REST client, and storage errors. - Created new error code extension files under a unified error code directory structure. - Updated import paths in various feature files to reflect the new error code structure. - Modified error handling in the readings timer bloc to utilize the new error code extensions for better localization support. - Updated tests to check for localized error messages instead of hardcoded strings. - Bumped version number to 2.11.12 in pubspec.yaml.
1 parent 304e7b2 commit cf6a5cc

44 files changed

Lines changed: 181 additions & 198 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

assets/lang/en_US.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@
127127
"field-cannot-be-empty-error": "This field cannot be empty",
128128
"invalid-ISBN-format-error": "Invalid ISBN format",
129129
"camera-error": "An error occurred with the camera: %s",
130-
"unknown-error": "unknown error",
131130
"enter-loaned-title-label": "Enter the title of the loaned book.",
132131
"enter-title-your-book-label": "Enter the title of your book.",
133132
"enter-bookcase-name-label": "Enter the name of the bookcase.",
@@ -268,16 +267,13 @@
268267
"error-auth-network-request-failed": "Connection lost. Check your internet connection and try again: %s",
269268
"error-auth-internal-error": "Something went wrong. If the problem persists, please contact support: %s",
270269
"error-storage-invalid-value": "Data storage issue detected. Try logging out and logging back in: %s",
271-
"error-storage-data-loss": "Error saving your data. Try syncing again or contact support if the issue continues: %s",
272-
"error-storage-not-found": "Your data could not be found. Try logging in again with your credentials: %s",
273270
"error-storage-write-failed": "Unable to save your changes. Check your storage space and try again: %s",
274271
"error-storage-read-failed": "Unable to load your data. Check your internet connection and try again: %s",
275272
"error-local-database-invalid-data": "The data provided is not valid. %s",
276273
"error-local-database-not-null-constraint": "A required field is empty. %s",
277274
"error-local-database-open-failed": "Could not open the database. %s",
278275
"error-local-database-operation-failed": "Database operation failed during read, write, or update. %s",
279276
"error-local-database-unique-constraint": "This record already exists in the database. %s",
280-
"error-local-database-unknown": "Unknown error in the database. %s",
281277
"notification-channel-loan-description": "Channel that notifies when it's time to receive your loaned book.",
282278
"notification-channel-loan-label": "Loans",
283279
"notification-channel-read-description": "Channel that notifies when it's time for reading.",

assets/lang/it_IT.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
"no-books-registered": "Nessun libro registrato. Torna alla pagina iniziale per registrare.",
9393
"enter-title-label": "Inserisci il Titolo",
9494
"enter-author-label": "Inserisci l'Autore",
95-
"enter-category-label": "Inserisci la Categoria (in Inglese)",
95+
"enter-category-label": "Inserisci la Categoria (Inglese)",
9696
"enter-publisher-label": "Inserisci l'Editore",
9797
"enter-isbn-label": "Inserisci l'ISBN",
9898
"delete-text-typed-tooltip": "Cancella il testo digitato.",
@@ -127,7 +127,6 @@
127127
"field-cannot-be-empty-error": "Questo campo non può essere vuoto",
128128
"invalid-ISBN-format-error": "Formato del ISBN non valido",
129129
"camera-error": "Si è verificato un errore con la fotocamera: %s",
130-
"unknown-error": "errore sconosciuto",
131130
"enter-loaned-title-label": "Inserisci il titolo del libro in prestito.",
132131
"enter-title-your-book-label": "Inserisci il titolo del tuo libro.",
133132
"enter-bookcase-name-label": "Inserisci il nome dello scaffale.",
@@ -268,16 +267,13 @@
268267
"error-auth-network-request-failed": "Connessione persa. Verifica la tua connessione internet e riprova: %s",
269268
"error-auth-internal-error": "Qualcosa è andato storto. Se il problema persiste, contatta l'assistenza: %s",
270269
"error-storage-invalid-value": "Problema rilevato nel salvataggio dei dati. Prova a disconnetterti e riconnetterti: %s",
271-
"error-storage-data-loss": "Errore durante il salvataggio dei dati. Prova a sincronizzare di nuovo o contatta l'assistenza se il problema persiste: %s",
272-
"error-storage-not-found": "I tuoi dati non sono stati trovati. Prova ad accedere di nuovo con le tue credenziali: %s",
273270
"error-storage-write-failed": "Impossibile salvare le tue modifiche. Verifica lo spazio di archiviazione e riprova: %s",
274271
"error-storage-read-failed": "Impossibile caricare i tuoi dati. Verifica la tua connessione internet e riprova: %s",
275272
"error-local-database-invalid-data": "I dati forniti non sono validi. %s",
276273
"error-local-database-not-null-constraint": "Un campo obbligatorio è vuoto. %s",
277274
"error-local-database-open-failed": "Impossibile aprire il database. %s",
278275
"error-local-database-operation-failed": "Operazione del database fallita durante lettura, scrittura o aggiornamento. %s",
279276
"error-local-database-unique-constraint": "Questo record esiste già nel database. %s",
280-
"error-local-database-unknown": "Errore sconosciuto del database. %s",
281277
"notification-channel-loan-description": "Canale che notifica quando è il momento di ricevere il libro prestato.",
282278
"notification-channel-loan-label": "Prestiti",
283279
"notification-channel-read-description": "Canale che notifica quando è il momento della lettura.",

assets/lang/pt_BR.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
"no-books-registered": "Nenhum livro cadastrado. Volte à página início para cadastrar.",
9393
"enter-title-label": "Digite o Título",
9494
"enter-author-label": "Digite o Autor",
95-
"enter-category-label": "Digite o Gênero (em Inglês)",
95+
"enter-category-label": "Digite o Gênero (Inglês)",
9696
"enter-publisher-label": "Digite a Editora",
9797
"enter-isbn-label": "Digite o ISBN",
9898
"delete-text-typed-tooltip": "Apagar o texto digitado.",
@@ -127,7 +127,6 @@
127127
"field-cannot-be-empty-error": "Esse campo não pode estar vazio",
128128
"invalid-ISBN-format-error": "Formato do ISBN inválido",
129129
"camera-error": "Ocorreu algum erro com a câmera: %s",
130-
"unknown-error": "erro desconhecido",
131130
"enter-loaned-title-label": "Digite o título do livro emprestado.",
132131
"enter-title-your-book-label": "Digite o título do seu livro.",
133132
"enter-bookcase-name-label": "Digite o nome da estante.",
@@ -268,16 +267,13 @@
268267
"error-auth-network-request-failed": "Conexão perdida. Verifique sua conexão com a internet e tente novamente: %s",
269268
"error-auth-internal-error": "Algo deu errado. Se o problema persistir, entre em contato com o suporte: %s",
270269
"error-storage-invalid-value": "Problema detectado ao salvar dados. Tente fazer logout e depois login novamente: %s",
271-
"error-storage-data-loss": "Erro ao salvar seus dados. Tente sincronizar novamente ou entre em contato com o suporte se o problema persistir: %s",
272-
"error-storage-not-found": "Seus dados não foram encontrados. Tente fazer login novamente com suas credenciais: %s",
273270
"error-storage-write-failed": "Impossível salvar suas alterações. Verifique o espaço de armazenamento e tente novamente: %s",
274271
"error-storage-read-failed": "Impossível carregar seus dados. Verifique sua conexão com a internet e tente novamente: %s",
275272
"error-local-database-invalid-data": "Os dados fornecidos não são válidos. %s",
276273
"error-local-database-not-null-constraint": "Um campo obrigatório está vazio. %s",
277274
"error-local-database-open-failed": "Não foi possível abrir o banco de dados. %s",
278275
"error-local-database-operation-failed": "Operação do banco de dados falhou durante leitura, escrita ou atualização. %s",
279276
"error-local-database-unique-constraint": "Este registro já existe no banco de dados. %s",
280-
"error-local-database-unknown": "Erro desconhecido no banco de dados. %s",
281277
"notification-channel-loan-description": "Canal que notifica quando é o dia de receber o livro emprestado.",
282278
"notification-channel-loan-label": "Empréstimos",
283279
"notification-channel-read-description": "Canal que notifica que está na hora da leitura.",

0 commit comments

Comments
 (0)