Skip to content

Throws exception when "result" doesn't appear in the response jsonObject #22

@cuteonion

Description

@cuteonion

When I run the method client.getJobResult(jobId),
the response is
{ "duration": "22.278 secs", "classPath": "events_introduction", "startTime": "2017-11-05T21:56:03.104+08:00", "context": "43ec02b5-events_introduction", "status": "FINISHED", "jobId": "6372e979-3a4c-4b4b-b155-8815dcc3310f" }
however, the 'result' field is missing. But I don't think the parser should throw an exception. I traced the code and found that if the status is "FINISHED" then all keys like "result" are required, otherwise it throws an exception.
Maybe we can just set field's value as null.
This scenario may be common when we try to get a job which was run long time ago.
I don't think this is a bug. But we can truly make it more friendly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions