hadiyarajesh/flower

Error class without data

Closed this issue · 4 comments

Currently, Error class is having access to nullable data property

We're providing local data in case of network error response, but I believe we should remove that data field and Error class should only contains errorMsg and status code.

Additionally, planning use errorMsg and statusCode as value class instead of primitives.

@DatL4g what are your thougths?

I already thought about that and wanted to do that.
However there is a use case that prevents this.

https://github.com/hadiyarajesh/flower/blob/master/flower-core/src/commonMain/kotlin/com/hadiyarajesh/flower_core/DBBoundResource.kt#L66

Even if the API access fails we want to get new values from the database (e.g. if the user updates the value himself)

Got it. So let it be.

I also thought to provide a class to get local db resource in order to monitor it's status (loading/success)

Have a look

Hey, @DatL4g

I've created a PR with few features.
Can you have a look and make it compatible with the latest ktorfit library?

I can see we've FlowerResponseConverter in ktorfit package but not using it anywhere. Is it something we can get rid of?

Resolved with PR #34