Exceptions for mysql

Hello all,

I need help for implement proper exception or error handling for mysql ,please let me know how i can achieve it.

Adonis uses a global exception handler. Can you provide example code where you are lacking the exception handling you need?

Hi Jacksoncharles,

try {

       const Qualifications = 
       await Database
       .distinct('sp_students_qualifications.qualification as id')
        return response.status(200).json(Qualifications)
     }catch(error ) {
      let data = {
      return response.status(500).json(data)

i m not getting proper errors on catch block.

What’s the error you get and what’s the error you are expecting?