Commit cded8215 authored by guillecxb's avatar guillecxb
Browse files

introduce exceptions for invoker

parent c791a924
Loading
Loading
Loading
Loading
Loading
+28 −16
Original line number Diff line number Diff line
@@ -10,10 +10,12 @@ capif_sdk_config_path = "./capif_sdk_config_sample.json"

import requests
import json
import sys

if __name__ == "__main__":
    logging.basicConfig(level=logging.INFO)

    try:
        # Onboard the Invoker (creates keys, registers, obtains certs)
        capif_connector = capif_invoker_connector(config_file=capif_sdk_config_path)
        capif_connector.onboard_invoker()
@@ -30,3 +32,13 @@ if __name__ == "__main__":

        # End
        print("🎉 Script finished successfully.")

    except FileNotFoundError as e:
        print(f"Error: {e}")
        sys.exit(1)
    except json.JSONDecodeError as e:
        print(f"Error reading the JSON file: {e}")
        sys.exit(1)
    except Exception as e:
        print(f"Unexpected error: {e}")
        sys.exit(1)
+2 −2
Original line number Diff line number Diff line
@@ -312,7 +312,7 @@
        }
    ],
    "description": "API of dummy Network-App to test",
    "supportedFeatures": "fffff",
    "supportedFeatures": "0",
    "shareableInfo": {
        "isShareable": true,
        "capifProvDoms": [
@@ -320,7 +320,7 @@
        ]
    },
    "serviceAPICategory": "string",
    "apiSuppFeats": "fffff",
    "apiSuppFeats": "0",
    "pubApiPath": {
        "ccfIds": [
            "string"