File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -178,24 +178,34 @@ protected function renderException($exception) {
178178 'message ' => $ exception ->getMessage (),
179179 ];
180180
181+ $ data = false ;
181182 if (YII_DEBUG ) {
182- $ result [ ' data ' ] = [
183+ $ data = [
183184 'type ' => get_class ($ exception )
184185 ];
185186 if (!$ exception instanceof UserException) {
186- $ result [ ' data ' ] += [
187+ $ data += [
187188 'file ' => $ exception ->getFile (),
188189 'line ' => $ exception ->getLine (),
189190 'stack-trace ' => explode ("\n" , $ exception ->getTraceAsString ())
190191 ];
191192
192193 if ($ exception instanceof \yii \db \Exception) {
193- $ result [ ' data ' ] ['error-info ' ] = $ exception ->errorInfo ;
194+ $ data ['error-info ' ] = $ exception ->errorInfo ;
194195 }
195196 }
196197 }
197198 if (($ prev = $ exception ->getPrevious ()) !== null ) {
198- $ result ['data ' ]['previous ' ] = $ this ->renderException ($ prev );
199+ $ data ['previous ' ] = $ this ->renderException ($ prev );
200+ }
201+
202+ if ($ data ) {
203+ if ($ exception instanceof JsonRpcException) {
204+ $ result ['data ' ] = $ data ;
205+ }
206+ else {
207+ $ result += $ data ;
208+ }
199209 }
200210
201211 return $ result ;
You can’t perform that action at this time.
0 commit comments