On the problem of abnormal (errorHandle) of Yii2

an uncertified API application

first of all, the Controller base class behaviors method is the default, inheriting only \ yii\ rest\ Controller , without adding additional authentication, and then customizing site/error

class TokenAuth extends \yii\filters\auth\HttpBasicAuth
{
    public function authenticate($user, $request, $response)
    {
        ...
        
        if(...)
        {
            throw new BadRequestHttpException("");
        }
        
        ...
    }
}

the problem is:
throws an exception in this method does not get a correct response , for example, the above should be 400, but it is actually 500, but it behaves normally in other behaviors , such as Verbfilter using incorrect HTTP verbs will get the correct exception return value. then what are the possibilities of this error

Mar.29,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b331fc-2be76.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b331fc-2be76.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?