File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
src/Symfony/Component/Mailer/Transport/Smtp/Stream Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ abstract class AbstractStream
27
27
protected $ stream ;
28
28
protected $ in ;
29
29
protected $ out ;
30
+ protected $ err ;
30
31
31
32
private $ debug = '' ;
32
33
@@ -65,7 +66,7 @@ abstract public function initialize(): void;
65
66
66
67
public function terminate (): void
67
68
{
68
- $ this ->stream = $ this ->out = $ this ->in = null ;
69
+ $ this ->stream = $ this ->err = $ this -> out = $ this ->in = null ;
69
70
}
70
71
71
72
public function readLine (): string
Original file line number Diff line number Diff line change @@ -45,14 +45,21 @@ public function initialize(): void
45
45
}
46
46
$ this ->in = &$ pipes [0 ];
47
47
$ this ->out = &$ pipes [1 ];
48
+ $ this ->err = &$ pipes [2 ];
48
49
}
49
50
50
51
public function terminate (): void
51
52
{
52
53
if (null !== $ this ->stream ) {
53
54
fclose ($ this ->in );
55
+ $ out = stream_get_contents ($ this ->out );
54
56
fclose ($ this ->out );
55
- proc_close ($ this ->stream );
57
+ $ err = stream_get_contents ($ this ->err );
58
+ fclose ($ this ->err );
59
+ $ exitCode = proc_close ($ this ->stream );
60
+ if ($ exitCode !== 0 ) {
61
+ throw new TransportException ('Process failed with exit code ' .$ exitCode .': ' .$ out .$ err );
62
+ }
56
63
}
57
64
58
65
parent ::terminate ();
You can’t perform that action at this time.
0 commit comments