承接 cloudoki/except-io-nal 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

cloudoki/except-io-nal

最新稳定版本:v0.5.2

Composer 安装命令:

composer require cloudoki/except-io-nal

包简介

The Cloudoki PHP Exception extensions throw manageable errors in a multi-tier MQ alignment

README 文档

README

The Cloudoki PHP Exception extensions throw manageable errors in a multi-tier MQ alignment.

The main goal of this package is to correctly bubble exceptions from the worker to the api layer. On the API layer, cases for production and development environments can be implemented.

####Dependencies None so far.

Install

  1. Add the cloudoki/except-io-nal package to your composer file (dev-master is fine).
  2. The Classes load as \Cloudoki\SomeException.
  3. Load the custom exception handler in App/Exceptions/Handler.php, like so:
namespace App\Exceptions;

use Cloudoki\Proc\ExceptionalHandler;

class Handler extends ExceptionalHandler {}

##Usage The package defines a set of Exception extensions. They are easy to emplement in any PHP environment, but are especially useful in a MQ alignment (API <-> Worker). The Exceptions assist worker level errors to correctly bubble up in the API response.

####DatabaseException We use the DatabaseException to define unexpected database responses and time-outs on connections.

####InvalidEnvironmentException If an interaction is triggered outside the desired environment scope (eg. development or production), an InvalidEnvironment should be thrown to kill the process.

####MissingParameterException A common exception in API applications. Bubbles a useful error message if set up correctly.

####InvalidParameterException Probably the most common custom Exception.

####IncompleteModelException While developing new model scopes, this exception can be useful to flag accidently accessed unfinished logic.

####MissingSchemaException Schema's are used in the Cloudoki/SchemaModel package. To be released soon.

####QuotaExceededException Some quota limitation has been exceeded. Used in eg. the Limiter package.

####InvalidUserException A default authorisation error response.

####WorkerException The API should define errors bubbled up from the Worker response as a WorkerException for logging purposes.

##Responses The exceptions are even more useful in a development/production divided environment, where an endpoint consumer has no business with internal problems as eg. a worker-level logic bug. By default, the package returns 3 responses.

400 Response

Malformed method or request syntax

403 Response

No valid authorization provided

404 Response

Not Found

A 500 response should be avoided in any production situation.

统计信息

  • 总下载量: 1.34k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-06-06