@@ -89,15 +89,15 @@ public static function download($name, $extend = [])
8989 }
9090 }
9191 } catch (TransferException $ e ) {
92- throw new Exception (config ( ' app_debug ' ) ? $ e -> getMessage () : "Addon package download failed " );
92+ throw new Exception ("Addon package download failed " );
9393 }
9494
9595 if ($ write = fopen ($ tmpFile , 'w ' )) {
9696 fwrite ($ write , $ content );
9797 fclose ($ write );
9898 return $ tmpFile ;
9999 }
100- throw new Exception (config ( ' app_debug ' ) && isset ( $ content ) ? $ content : "No permission to write temporary files " );
100+ throw new Exception ("No permission to write temporary files " );
101101 }
102102
103103 /**
@@ -121,7 +121,7 @@ public static function unzip($name)
121121 $ zip ->openFile ($ file );
122122 } catch (ZipException $ e ) {
123123 $ zip ->close ();
124- throw new Exception (config ( ' app_debug ' ) ? $ e -> getMessage () : 'Unable to open the zip file ' );
124+ throw new Exception ('Unable to open the zip file ' );
125125 }
126126
127127 $ dir = self ::getAddonDir ($ name );
@@ -133,7 +133,7 @@ public static function unzip($name)
133133 try {
134134 $ zip ->extractTo ($ dir );
135135 } catch (ZipException $ e ) {
136- throw new Exception (config ( ' app_debug ' ) ? $ e -> getMessage () : 'Unable to extract the file ' );
136+ throw new Exception ('Unable to extract the file ' );
137137 } finally {
138138 $ zip ->close ();
139139 }
@@ -1121,9 +1121,9 @@ public static function sendRequest($url, $params = [], $method = 'POST')
11211121 $ content = $ body ->getContents ();
11221122 $ json = (array )json_decode ($ content , true );
11231123 } catch (TransferException $ e ) {
1124- throw new Exception (config ( ' app_debug ' ) ? $ e -> getMessage () : __ ('Network error ' ));
1124+ throw new Exception (__ ('Network error ' ));
11251125 } catch (\Exception $ e ) {
1126- throw new Exception (config ( ' app_debug ' ) ? $ e -> getMessage () : __ ('Unknown data format ' ));
1126+ throw new Exception (__ ('Unknown data format ' ));
11271127 }
11281128 return $ json ;
11291129 }
0 commit comments