File tree 3 files changed +48
-5
lines changed
3 files changed +48
-5
lines changed Original file line number Diff line number Diff line change @@ -38,12 +38,26 @@ public function actionUpdate()
38
38
Yii::createObject (PackageUpdateCommand::class, [$ package ])->run ();
39
39
} catch (UpdateRateLimitException $ exception ) {
40
40
Yii::$ app ->session ->addFlash ('rate-limited ' , true );
41
- } catch (\Composer \Downloader \TransportException $ exception ) {
42
- if (stripos ($ exception ->getMessage (), 'not found ' )) {
41
+ } catch (\Composer \Downloader \TransportException $ e ) {
42
+ if (stripos ($ e ->getMessage (), 'not found ' )) {
43
+ Yii::warning ('Failed to update ' . $ package ->getFullName () . ': ' . $ e ->getMessage (), __METHOD__ );
44
+
43
45
return $ this ->renderPartial ('not-found ' , ['package ' => $ package ]);
44
46
}
45
47
46
- return $ this ->renderPartial ('transport-error ' );
48
+ throw $ e ;
49
+ } catch (\Composer \Repository \InvalidRepositoryException $ e ) {
50
+ Yii::warning ('Failed to update ' . $ package ->getFullName () . ': ' . $ e ->getMessage (), __METHOD__ );
51
+
52
+ return $ this ->renderPartial ('fetch-error ' , ['package ' => $ package , 'exception ' => $ e ]);
53
+ } catch (Exception $ e ) {
54
+ Yii::error ([
55
+ 'UNKNOWN error during ' . $ package ->getFullName () . ' update ' ,
56
+ get_class ($ e ),
57
+ $ e ->getMessage (),
58
+ ], __METHOD__ );
59
+
60
+ return $ this ->renderPartial ('fetch-error ' , ['package ' => $ package , 'exception ' => $ e ]);
47
61
}
48
62
49
63
$ package ->load ();
Original file line number Diff line number Diff line change 10
10
11
11
<?php
12
12
$ releases = $ package ->getReleases ();
13
- ksort ($ releases );
14
- $ releases = array_reverse ($ releases );
15
13
?>
16
14
17
15
<div class="versions">
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ /**
4
+ * @var \yii\web\View $this
5
+ * @var \hiqdev\assetpackagist\models\AssetPackage $package
6
+ * @var \Composer\Repository\InvalidRepositoryException $exception
7
+ */
8
+
9
+ use yii \helpers \Html ;
10
+
11
+ $ this ->title = 'Package update failed ' ;
12
+
13
+ ?>
14
+ <hr/>
15
+ <h3><?= $ this ->title ?> </h3>
16
+
17
+ <blockquote><?= $ exception ->getMessage () ?> </blockquote>
18
+
19
+ <?php
20
+
21
+ if ($ package ->getType () === 'npm ' ) {
22
+ $ link = Html::a ('npmjs.com ' , 'https://npmjs.com/search?q= ' . $ package ->getName (), ['target ' => '_blank ' ]);
23
+ } elseif ($ package ->getType () === 'bower ' ) {
24
+ $ link = Html::a ('bower.io ' , 'https://bower.io/search?q= ' . $ package ->getName (), ['target ' => '_blank ' ]);
25
+ }
26
+
27
+ ?>
28
+
29
+ <h4>Could you ensure this package exists on <?= $ link ?> ?</h4>
30
+ <p>Think asset-packagist is guilty? <?= Html::a ('Report on GitHub ' , 'https://github.com/hiqdev/asset-packagist/issues/new ' ) ?>
31
+ </p>
You can’t perform that action at this time.
0 commit comments