Code Monkey home page Code Monkey logo

Comments (2)

nedroden avatar nedroden commented on July 18, 2024

In one of the school projects I'm currently doing, errors are handled like this: the execute() method returns an integer (the error code). The main class then checks if the return code is equal to zero. If so, no errors occurred and the display() method can be invoked. If not, the appropriate error message is displayed like this:

switch ($returnCode) {
    case ReturnCode::GENERAL_ERROR:
        $errorMessage = 'general_error';
        break;
    ...
}

This would be a lot cleaner, since more advanced errors (for example, if you need to specify field names) could be handled by the model itself. If a model method returns an error code, the controller would then check the $errors array and handle the error and call an error template manually (in the display() method).

Database errors are always fatal, so we wouldn't have to worry about them.

Management panel-related errors would be handled by the management controller, since it uses a different layout.

from draiwiki.

nedroden avatar nedroden commented on July 18, 2024

The following management panel sections will be postponed indefinitely:

  • Security log
  • Server & database settings
  • Advanced theme management (will be moved to general settings for the time being)
  • Manual (might redirect to the official wiki)

Features that will possibly be postponed as well:

  • Maintenance actions
  • Bans

The reason that these features are postponed is a lack of time. Besides, most of these are nice to have, but not absolutely required.

from draiwiki.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.