From fb10cc8c3542f8f894ad6b50f3d78e3eadeabec0 Mon Sep 17 00:00:00 2001
From: Daniel Seifert <ds@shopmodule.com>
Date: Tue, 21 Sep 2021 11:33:10 +0200
Subject: [PATCH] more precise error messages

---
 src/Translatable.php | 4 ++--
 src/Wplang.php       | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/Translatable.php b/src/Translatable.php
index 855dfb8..ec5add6 100644
--- a/src/Translatable.php
+++ b/src/Translatable.php
@@ -100,14 +100,14 @@ class Translatable {
 				break;
 
 			default:
-				throw new \Exception( 'Unknown package type' );
+				throw new \Exception( sprintf('Unknown package type "%s"', $this->type) );
 		}
 
 		$body = file_get_contents( $url );
 		$res = json_decode( $body );
 
 		if ( ! isset( $res->translations ) || empty( $res->translations ) ) {
-			throw new \Exception( 'No translations found' );
+			throw new \Exception( sprintf('No translations found for %s', $this->slug) );
 		}
 
 		$translations = [];
diff --git a/src/Wplang.php b/src/Wplang.php
index 2b074c8..b376b4d 100644
--- a/src/Wplang.php
+++ b/src/Wplang.php
@@ -137,7 +137,7 @@ class Wplang implements PluginInterface, EventSubscriberInterface {
 				}
 			}
 		} catch ( \Exception $e ) {
-			$this->io->writeError( $e->getMessage() );
+			$this->io->writeError( '      - ' . $e->getMessage() );
 		}
 
 	}
-- 
GitLab