Comments (4)
after some conversation with the team, it looks like the important points are the following:
- allow developers to catch errors that are actionable. this class of errors is a Runtime. contrast this with Logic errors
- i.e. an archive cannot be started because there is nobody connected to the session – a developer can retry.
- allow developers to group errors by dependency/feature
- i.e. each error we throw should be an OpenTokError. All archiving errors can be ArchivingErrors that inherit from OpenTokErrors.
from opentok-php-sdk.
found a pretty good article that discusses best practices in PHP: http://ralphschindler.com/2010/09/15/exception-best-practices-in-php-5-3
According to this article, here is a proposed design for exceptions in the SDK:
OpenTok\Exception
- an interface that serves as a way for consumers to catch package level exceptions. all other exceptions will implement this interfaceOpenTok\ArchiveException
- an interface that serves as a way for consumer to catch Archiving component level exceptions. all exceptions that are a result of an archiving operation will implement this interfaceOpenTok\InvalidArgumentException extends \InvalidArgumentException
- our own subclass of the system provided exception class so we can implement the interfaces we need to encapsulate.OpenTok\UnexpectedValueException extends \UnexpectedValueException
- similar reasoning as above - used for generic server response errors that are aren't described elsewhere.OpenTok\DomainException extends \DomainException
- similar reasoning as aboveOpenTok\AuthenticationException extends OpenTok\DomainException
- 401's and such.OpenTok\ArchiveAuthenticationException extends OpenTok\AuthenticationException
- same as above but implements the OpenTok\ArchiveException interface.OpenTok\ArchiveDomainException extends OpenTok\DomainException
- adds implementation of OpenTok\ArchiveException. - used for almost all other 4xx response codes because they are mostly logic issue driven.OpenTok\ArchiveUnexpectedValueException extends OpenTok\UnexpectedValueException
- adds implementation of OpenTok\ArchiveException interface. - used for archiving 5xx response codes.
from opentok-php-sdk.
this needs test coverage still
from opentok-php-sdk.
going to call this one fixed and open a new issue for the test coverage.
from opentok-php-sdk.
Related Issues (20)
- opentok/src/OpenTok/Util/Client.php - handleSignalingException sporadically causes another unhandled exception HOT 1
- How I can set a time limit for video call? HOT 1
- ClientTest.php causes a Composer deprecation notice when updating opentok/opentok HOT 1
- Client error: `POST https://api.opentok.com/session/create` resulted in a `403 Forbidden` response: <?xml version="1.0" encoding="UTF-8" standalone="yes"?><errorPayload><code>-1</code><message>No suitable authentication (truncated...) in my larvel project HOT 2
- PHP 8 support HOT 1
- 4.10.0 SIP dialing error HOT 4
- jquery-3.4.1.min.js: 2 vulnerabilities (highest severity is: 6.1) HOT 1
- bootstrap-3.0.0.min.js: 6 vulnerabilities (highest severity is: 6.1) - autoclosed HOT 3
- firebase/php-jwt-v5.5.1: 1 vulnerabilities (highest severity is: 9.1) - autoclosed HOT 1
- phpunit/phpunit-8.5.26: 2 vulnerabilities (highest severity is: 6.1) - autoclosed HOT 1
- jquery-1.10.2.min.js: 4 vulnerabilities (highest severity is: 6.1) - autoclosed HOT 1
- Invalid stream object HOT 1
- Screenshare Dialogue box HOT 2
- 4.11.0 SIP dialing error HOT 1
- phpunit/phpunit-8.5.31: 2 vulnerabilities (highest severity is: 6.1) - autoclosed HOT 1
- bootstrap-4.0.0.min.js: 4 vulnerabilities (highest severity is: 6.1) HOT 1
- The apiKey was not a string nor an integerin laravel project HOT 2
- Error 409 with the "startArchive" function HOT 1
- Fix Sample App SipCall
- E_ERROR: Cannot redeclare OpenTok\Util\array_is_list() (previously declared in/opentok/opentok/src/OpenTok/Util/Validators.php:465 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opentok-php-sdk.