Skip to content
This repository was archived by the owner on Feb 14, 2025. It is now read-only.
This repository was archived by the owner on Feb 14, 2025. It is now read-only.

ClassCastException when Sched returns Error-Response #12

@giuseppeman

Description

@giuseppeman

When the Sched-API throws an error, it returns 200:OK with a String message containing the detailed error "e.g. ERR: wrong email".
The Sched-Client cannot handle this and returns the following error:

class java.lang.String cannot be cast to class software.xdev.sched.model.UserAdded (java.lang.String is in module java.base of loader 'bootstrap'; software.xdev.sched.model.UserAdded is in unnamed module of loader com.amazonaws.services.lambda.runtime.api.client.CustomerClassLoader @1ddc4ec2): java.lang.ClassCastException
java.lang.ClassCastException: class java.lang.String cannot be cast to class software.xdev.sched.model.UserAdded (java.lang.String is in module java.base of loader 'bootstrap'; software.xdev.sched.model.UserAdded is in unnamed module of loader com.amazonaws.services.lambda.runtime.api.client.CustomerClassLoader @1ddc4ec2)
	at software.xdev.sched.api.UserApi.addUser(UserApi.java:158)
	at software.xdev.sched.api.UserApi.addUser(UserApi.java:81)
	...

This should be handled differently, so that i can find out the error from Sched, without having to work around a class-cast exception.

NOTE: When the Sched API returns an error, if it return 200, the String-Message in the body always starts with "ERR:"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions