Hey Davide,

No worries, I was just curious after looking at the http parser. Been
trying to think of a way around this for a minute.

Was hoping to have an invalid movie ID return an exception that my
try/except statement will recognize like a null value, however, the
incorrect id (say, get_movie(‘0’) returns the long 404 error and exits the
program.

 thanks for your help,

-Anthony

On Sun, Oct 8, 2017 at 12:29 PM Davide Alberani <davide.alber...@gmail.com>
wrote:

> Hi Anthony,
>
> Uh... the choice to raise a warning was poor, I admit it. :-)
>
> You can do something like that:
>
> m = ia.get_movie(<invalid movie ID>)
> if not m.keys():
>     print('this movie does not exist')
>
> Anyway, I have some plans about simplifying / extending IMDbPY.
> Who knows if I'll ever have the time to act.
>
> (I'll try to send a mail to imdbpy-devel in the next 2 weeks, about it)
>
>
> On Fri, Oct 6, 2017 at 6:06 PM, Anthony Pecoraro <ap...@umich.edu> wrote:
> > Greetings,
> >
> > Is there a way to have the following code return a recognizable error in
> my
> > program? Trying to generate a random movie using a random integer.
> >
> > m = ia.get_movie(<invalid movie ID>)
> >
> > Thanks,
> >
> >
> >
> >
>
>
>
> --
> Davide Alberani <davide.alber...@gmail.com>  [PGP KeyID:
> 0x3845A3D4AC9B61AD]
> http://www.mimante.net/
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Imdbpy-help mailing list
Imdbpy-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/imdbpy-help

Reply via email to