Gracefully handle OhDear SDK errors

Created on 8 November 2023, 8 months ago
Updated 16 April 2024, 2 months ago

Problem/Motivation

If ohdear api key is missing or parameters are out of bound we see this drush error.

$ drush ohdear:info          

                                                            
  There are no commands defined in the "ohdear" namespace.  

$ drush ohdear:uptime  --split month --from 20220101000000 #(site did not exist in 2022)

                                                            
  There are no commands defined in the "ohdear" namespace.  

It would be more helpful if the error provided would be more descriptive.

🐛 Bug report
Status

Needs work

Version

2.0

Component

Code

Created by

🇸🇮Slovenia useernamee Ljubljana

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @useernamee
  • 🇸🇮Slovenia useernamee Ljubljana
  • Status changed to Needs review 4 months ago
  • 🇳🇱Netherlands roderik Amsterdam,NL / Budapest,HU

    This is gone after we don't do error-logging/throwing in service constructors anymore, i.e. with 📌 Dependency injection anti-patterns Needs review applied:

    $ drush ohdear:info
    
    In OhDearSdkService.php line 89:
    
      OhDear API key is missing.
    

    Just setting this to Needs Review because I can't really close it myself yet until after you approve #3403202.

  • 🇸🇮Slovenia useernamee Ljubljana

    There is also an issue when visiting /admin/reports/ohdear/info. The site breaks if api key is wrong or missing. Controller probably needs some error handling or the ohdear service.

  • Status changed to Needs work 2 months ago
  • 🇸🇮Slovenia useernamee Ljubljana
Production build 0.69.0 2024