Re: [Imdbpy-help] 404 code returned

2017-10-09 Thread Anthony Pecoraro
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 
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()
> 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  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()
> >
> > Thanks,
> >
> >
> >
> >
>
>
>
> --
> Davide Alberani   [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


[Imdbpy-help] 404 code returned

2017-10-06 Thread Anthony Pecoraro
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()

Thanks,
--
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