[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MirageOS-devel] Handling Lwt exceptions



On Thu, May 5, 2016 at 12:01 PM, Joel Hughes <rudenoise@xxxxxxxxx> wrote:
> Morning all,
>
> I was hoping to get some pointers to good/simple examples of error-handling
> in Lwt.
>
> After yesterday's call I started looking at getting latest "tag" rather than
> "release" using ocaml-github - Github's API's concept of a release is
> distinct from git tagging, which explains some repos showing no releases.
>
> The approach is fine for repos that have tags but
> Github.Repo.get_tags_and_times raises an Lwt exception for repos without any
> tags.

Hi Joel,

That sounds like a bug in Github.Repo.get_tags_and_times. Could you
please file a bug report at <https://github.com/mirage/ocaml-github>?

In the meantime, the Lwt.catch function
<https://ocsigen.org/lwt/dev/api/Lwt#VALcatch> may be what you are
looking for.

Hope this helps,

David

> https://github.com/rudenoise/mirage-dashboard/blob/tags/src/get_releases.ml#L66
>
> I'd like to get my head around how I could catch this exception and swallow
> it (as needed during the cycle through each repo) - returning a default
> value/message.
>
> Does anyone have a link to a very simple example or tutorial, I'm having
> trouble finding one?
>
> Thanks
>
> Joel
>
> _______________________________________________
> MirageOS-devel mailing list
> MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
> http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel
>

_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.