Skip to content

Next

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
Minds Backend - Engine
Minds Backend - Engine
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
    • Insights
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
    • Locked Files
  • Issues 240
    • Issues 240
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 32
    • Merge Requests 32
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Packages
    • Packages
    • List
    • Container Registry
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Minds
  • Minds Backend - EngineMinds Backend - Engine
  • Issues
  • #790

Closed
Open
Opened 16 minutes ago by Mark Harding@markeharding
  • Report abuse
  • New issue
Report abuse New issue

(discussion): The state of exceptions

  • When should exceptions be used?
  • Which exceptions should be considered friendly, and which ones system errors?
  • Which exceptions should be delivered to a user?

Minds\Core\Exceptions\ApiException

eg:

class InvalidMethod extends ApiException
{
    private $message = "This method is not allowed";
}

Minds\Core\Exceptions\UserException

Sentry should not catch these errors and the API should cleanly report the error message.

class InsufficientBalance extends UserException
{
    private $message = "You do not have enough tokens to fulfill this transaction";
}

Minds\Core\Exceptions\ApplicationException

Sentry should log, and the API may return a generic message.

class DatabaseException extends ApplicationException
{
    private $message = "The database couldn't be communicated with";
}

Minds\Core\Exceptions\Exception

Sentry should log, and the API should return a traceable error code.

class Exception extends \Exception
{
    private $message = "There was unknown error";
}

Please solve the reCAPTCHA

We want to be sure it is you, please confirm you are not a robot.

Edited 14 minutes ago by Mark Harding

Related issues
0

    • Discussion 1
    • Designs 0
    • Mark Harding @markeharding changed the description 2 times within 1 minute 14 minutes ago

      changed the description 2 times within 1 minute

    • You're only seeing other activity in the feed. To add a comment, switch to one of the following options.
    Please register or sign in to reply

    The one place for your designs

    Upload and view the latest designs for this issue. Consistent and easy to find, so everyone is up to date.

    0 Assignees
    None
    Assign to
    None
    Epic
    None
    None
    Milestone
    None
    Assign milestone
    None
    Time tracking
    No estimate or time spent
    None
    Due date
    None
    0
    Labels
    None
    Assign labels
    • View project labels
    None
    Weight
    None
    Confidentiality
    Not confidential
    Lock issue
    Unlocked
    1
    1 participant
    user avatar
    Mark Harding
    Reference: minds/engine#790