Skip to content
DataMiner DoJo

More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Search in posts
Search in pages
Log in
Menu
  • Updates & Insights
  • Questions
  • Learning
    • E-learning Courses
    • Empower Replay: Limited Edition
    • Tutorials
    • Open Classroom Training
    • Certification
      • DataMiner Fundamentals
      • DataMiner Configurator
      • DataMiner Automation
      • Scripts & Connectors Developer: HTTP Basics
      • Scripts & Connectors Developer: SNMP Basics
      • Visual Overview – Level 1
      • Verify a certificate
    • Video Library
    • Books We Like
    • >> Go to DataMiner Docs
  • Expert Center
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Markets & Industries
      • Media production
      • Government & defense
      • Content distribution
      • Service providers
      • Partners
      • OSS/BSS
    • Agile
      • Agile Webspace
      • Everything Agile
        • The Agile Manifesto
        • Best Practices
        • Retro Recipes
      • Methodologies
        • The Scrum Framework
        • Kanban
        • Extreme Programming
      • Roles
        • The Product Owner
        • The Agile Coach
        • The Quality & UX Coach (QX)
    • DataMiner DevOps Professional Program
      • About the DevOps Program
      • DataMiner DevOps Support
  • Downloads
  • More
    • DataMiner Releases & Updates
    • Feature Suggestions
    • Climb the leaderboard!
    • Swag Shop
    • Contact
      • General Inquiries
    • Global Feedback Survey
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Deal Registration
  • >> Go to dataminer.services

Help Defining HTTP API Error Handling in My First Driver

325 views5th March 2025Connector error handling HTTP
1
Deema Mahmud32 4th March 2025 0 Comments

Hello Everyone,

I am currently developing my first driver, and I need some help with handling errors in my HTTP-based protocol. The API documentation defines an error response schema with only two parameters:

  • code (integer, optional)
  • message (string, optional)

However, there is no specific description of what these error codes or messages represent. Additionally, the default error response is labeled as "Invalid request" without further details.

My Questions:

  1. How should I define this error structure in my protocol?

    • What parameters do I need to capture from the API response?
    • How should I structure error logging and handling?
  2. How should I implement this in my protocol (from parameter to trigger to QAction)?

    • What’s the best way to handle this in a QAction or a trigger?
    • Should I create a dedicated error-handling QAction?

Any guidance on how to structure this properly would be greatly appreciated. Thanks in advance!

Felix Wesemeier [DevOps Catalyst] Answered question 5th March 2025

2 Answers

  • Active
  • Voted
  • Newest
  • Oldest
0
frans siew [SLC] [DevOps Advocate]915 Posted 5th March 2025 0 Comments

Hi Deema,

  1. How should I define this error structure in my protocol?
    • What parameters do I need to capture from the API response?
      • the code to check if it is a valid http call and the content/error message
    • How should I structure error logging and handling?
      • you could display the error message via the protocol.log (if using a qaction) alternatively could set an exception value to the parameter that the api response is updating
  2. How should I implement this in my protocol (from parameter to trigger to QAction)?
    • What’s the best way to handle this in a QAction or a trigger?
      • if you are already going to process the response in a QAction, you could check the HTTP code there. Since we do not know what is the HTTP code, you could test it by trying to send an invalid request to the device to check the HTTP code that it gives.

        Alternatively you could also to process the response only if your HTTP code is '200'

        if you are not going to process the response in a qaction, you could have an after trigger with a condition to check if you got an error and do any follow up action like setting an exception value to a parameter

    • Should I create a dedicated error-handling QAction?
        • you could create a generic error handling in the precompile QA to share code which would allow you to reduce duplicate code to process exceptions for other http calls

I hope these answers help

frans siew [SLC] [DevOps Advocate] Answered question 5th March 2025
You are viewing 1 out of 2 answers, click here to view all answers.
Please login to be able to comment or post an answer.

My DevOps rank

DevOps Members get more insights on their profile page.

My user earnings

0 Dojo credits

Spend your credits in our swag shop.

0 Reputation points

Boost your reputation, climb the leaderboard.

Promo banner DataMiner DevOps Professiona Program
DataMiner Integration Studio (DIS)
Empower Katas
Privacy Policy • Terms & Conditions • Contact

© 2025 Skyline Communications. All rights reserved.

DOJO Q&A widget

Can't find what you need?

? Explore the Q&A DataMiner Docs

[ Placeholder content for popup link ] WordPress Download Manager - Best Download Management Plugin