定制 mggflow/exception-manager 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mggflow/exception-manager

最新稳定版本:v3.3.1

Composer 安装命令:

composer require mggflow/exception-manager

包简介

README 文档

README

About

This package is using to create universal exceptions with codes based on exception sense.

Usage

To install:

composer require mggflow/exception-manager

Example:

try {
    throw ManageException::build()
        ->log()->warning()->b()
        ->desc()->internal()->tooMany(null, 'Requests')
        ->context(uniqid(), 'importantID')->b()
        ->fill();
} catch (UniException $uniException) {
    echo '<pre>';
    var_dump($uniException->getCode());
    var_dump($uniException->getMessage());
    var_dump($uniException->getInternalMessage());
    var_dump($uniException->getLogLvl());
    var_dump($uniException->getContext());
    var_dump($uniException->getMessageParts());
    echo '</pre>';
}

Expected output:

int(13)
string(14) "Internal Error"
string(17) "Too many Requests"
int(32)
array(1) {
  ["importantID"]=>
  string(13) "64050ff0be4fa"
}
array(1) {
  [0]=>
  array(2) {
    [0]=>
    int(13)
    [1]=>
    array(2) {
      [0]=>
      string(8) "too many"
      [1]=>
      string(8) "Requests"
    }
  }
}

统计信息

  • 总下载量: 151
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 8
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-03-04