37 lines
1.1 KiB
PHP
37 lines
1.1 KiB
PHP
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | YwxApp [ WE CAN DO IT JUST THINK ]
|
|
// +----------------------------------------------------------------------
|
|
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
|
|
// +----------------------------------------------------------------------
|
|
// | Author: ywxapp<admin@ywxapp.cn>
|
|
// +----------------------------------------------------------------------
|
|
|
|
namespace ywxapp\exceptions;
|
|
|
|
/**
|
|
* Class PayException
|
|
* @package ywxapp\exceptions
|
|
*/
|
|
class PayException extends \RuntimeException
|
|
{
|
|
|
|
public function __construct($message, $replace = [], $code = 0, \Throwable $previous = null)
|
|
{
|
|
if (is_array($message)) {
|
|
$errInfo = $message;
|
|
$message = $errInfo[1] ?? '未知错误';
|
|
if ($code === 0) {
|
|
$code = $errInfo[0] ?? 400;
|
|
}
|
|
}
|
|
|
|
if (is_numeric($message)) {
|
|
$code = $message;
|
|
$message = getLang($message, $replace);
|
|
}
|
|
|
|
parent::__construct($message, $code, $previous);
|
|
}
|
|
}
|