Add more information on error messages

This commit is contained in:
elpamplina 2025-07-21 19:36:45 +02:00
parent 6203a76198
commit ecbdf6709a
8 changed files with 20 additions and 13 deletions

View file

@ -1,5 +1,11 @@
# Changelog
## [1.1.2](https://github.com/elpamplina/mastodon-threading/compare/1.1.1...1.1.2)
### New features
* Error messages more informative.
## [1.1.1](https://github.com/elpamplina/mastodon-threading/compare/1.1.0...1.1.1)
### Bug fixes

View file

@ -54,11 +54,11 @@
"no_selection": "Kein Text ausgewählt!",
"no_text": "Kein Text zum Versenden!",
"size_exceeded": "NICHT VERSENDET: Mehr als {{max}} Zeichen in einem Beitrag.",
"file_size_exceeded": "NICHT VERSENDET: Größe der Anhänge wurde überschritten.",
"file_size_exceeded": "NICHT VERSENDET: Größe der Anhänge wurde überschritten: {{file}}",
"alt_exceeded": "NICHT VERSENDET: Mehr als {{max}} Zeichen in der Beschreibung.",
"attachment_exceeded": "NICHT VERSENDET: Mehr als {{max}} angehängte Dateien in einem Beitrag.",
"void_fragment": "NICHT VERSENDET: Leere Fragmente können nicht versendet werden! (z.B. Leerzeilen außerhalb des Threads)",
"file_not_found": "FEHLER: Angehängte Dateien konnten nicht gefunden werden.",
"file_not_found": "FEHLER: Angehängte Dateien konnten nicht gefunden werden: {{file}}",
"filetype_not_allowed": "FEHLER: Typ des Anhangs wird nicht unterstützt.",
"rate_limit": "FEHLER: Postlimit erreicht. Warten Sie 5 Minuten und versuchen Sie es erneut."
}

View file

@ -54,11 +54,11 @@
"no_selection": "No text selected!",
"no_text": "No text to send!",
"size_exceeded": "NOT SENT: More than {{max}} characters in one post.",
"file_size_exceeded": "NOT SENT: Attachment size exceeded.",
"file_size_exceeded": "NOT SENT: Attachment size exceeded: {{file}}",
"alt_exceeded": "NOT SENT: More than {{max}} characters in description.",
"attachment_exceeded": "NOT SENT: More than {{max}} images in one post.",
"void_fragment": "NOT SENT: Can't send empty fragments!",
"file_not_found": "ERROR: Attachment file not found.",
"file_not_found": "ERROR: Attachment file not found: {{file}}",
"filetype_not_allowed": "ERROR: Attachment type not supported.",
"rate_limit": "ERROR: Post limit reached. Wait 5 minutes and retry."
}

View file

@ -56,11 +56,11 @@
"no_selection": "¡No hay texto seleccionado!",
"no_text": "¡No hay texto para enviar!",
"size_exceeded": "NO ENVIADO: Se superan los {{max}} caracteres.",
"file_size_exceeded": "NO ENVIADO: Se supera el tamaño de archivo adjunto.",
"file_size_exceeded": "NO ENVIADO: Se supera el tamaño de archivo adjunto: {{file}}",
"alt_exceeded": "NO ENVIADO: Se superan los {{max}} caracteres en la descripción.",
"attachment_exceeded": "NO ENVIADO: Se superan las {{max}} imágenes en un post.",
"void_fragment": "NO ENVIADO: Hay fragmentos vacíos.",
"file_not_found": "ERROR: Archivo adjunto no encontrado.",
"file_not_found": "ERROR: Archivo adjunto no encontrado: {{file}}",
"filetype_not_allowed": "ERROR: Tipo de adjunto no soportado.",
"rate_limit": "ERROR: Límite de posts alcanzado. Espera 5 minutos para reintentar."
}

View file

@ -271,13 +271,13 @@ export default class MastodonThreading extends Plugin {
if (mimetype.startsWith('image')) {
if (post.images.some(it => !it.isimage)) {
// Trying to add image to videos
new Notice(t('error.filetype_not_allowed'));
new Notice(t('error.filetype_not_allowed', {file: m[1]}));
return;
}
}
else {
// Trying to add video to another media
new Notice(t('error.filetype_not_allowed'));
new Notice(t('error.filetype_not_allowed', {file: m[1]}));
return;
}
}
@ -287,12 +287,12 @@ export default class MastodonThreading extends Plugin {
// @ts-ignore
file = this.app.vault.getFileByPath(`${this.app.vault.getConfig("attachmentFolderPath").replace(/^\.\//, '')}/${m[1]}`);
if (file === null) {
new Notice(t('error.file_not_found'));
new Notice(t('error.file_not_found', {file: m[1]}));
return;
}
}
if (file.stat.size > (mimetype.startsWith('image') ? this.settings.serverMaxImage : this.settings.serverMaxVideo)) {
new Notice(t('error.file_size_exceeded'));
new Notice(t('error.file_size_exceeded', {file: m[1]}));
return;
}
let desc: string = '';

View file

@ -1,7 +1,7 @@
{
"id": "mastodon-threading",
"name": "Mastodon Threading",
"version": "1.1.1",
"version": "1.1.2",
"minAppVersion": "1.7.7",
"description": "Compose and post threads to Mastodon.",
"author": "El Pamplina de Cai",

View file

@ -1,6 +1,6 @@
{
"name": "mastodon-threading",
"version": "1.1.1",
"version": "1.1.2",
"description": "Obsidian plugin to compose and post threads to Mastodon",
"main": "main.js",
"scripts": {

View file

@ -7,5 +7,6 @@
"1.0.8": "1.7.7",
"1.0.9": "1.7.7",
"1.1.0": "1.7.7",
"1.1.1": "1.7.7"
"1.1.1": "1.7.7",
"1.1.2": "1.7.7"
}