Is there a way to grab errors for Google App Engine's getImageServingUrl?











up vote
0
down vote

favorite












This a php application running on Google App Engine. I'm using getImageServingUrl to get a url and store it for later use. I've actually implemented this in another part of the application, but in this case, when run, the php code stops right at the point where I make the call to get the url. The are no errors in the page or in the App Engine log. Is there another place to get errors? I'm not having luck tracking down the issue. Here's what I have:



// At the top of the page I call this
use googleappengineapicloud_storageCloudStorageTools;

// Some processing takes place to get the storage location of the image then
if (is_file($full_path_photo)) {

echo 'Getting URL...<br>';
$object_public_url = CloudStorageTools::getImageServingUrl($full_path_photo, ['secure_url' => true]);
echo 'Successful<br>';
};

// I've also tried it like this:
$object_public_url = CloudStorageTools::getImageServingUrl($full_path_photo);

// And adding this before the call:
CloudStorageTools::deleteImageServingUrl($full_path_photo);


When I run this, I get the "Getting URL...", then nothing. The page just stops executing.










share|improve this question






















  • You should try-catch your code to see if any exception is throwed. Following the doc, it may throw a InvalidArgumentException or a googleappengineapicloud_storageCloudStorageException
    – Tom Ah
    Nov 11 at 22:46










  • I was thinking that somewhere in the last four hours I had tried that, but doing it this time did produce a result - "Unspecified error with image". The error is kind of a let down, but better than nothing.
    – fitz
    Nov 11 at 23:26















up vote
0
down vote

favorite












This a php application running on Google App Engine. I'm using getImageServingUrl to get a url and store it for later use. I've actually implemented this in another part of the application, but in this case, when run, the php code stops right at the point where I make the call to get the url. The are no errors in the page or in the App Engine log. Is there another place to get errors? I'm not having luck tracking down the issue. Here's what I have:



// At the top of the page I call this
use googleappengineapicloud_storageCloudStorageTools;

// Some processing takes place to get the storage location of the image then
if (is_file($full_path_photo)) {

echo 'Getting URL...<br>';
$object_public_url = CloudStorageTools::getImageServingUrl($full_path_photo, ['secure_url' => true]);
echo 'Successful<br>';
};

// I've also tried it like this:
$object_public_url = CloudStorageTools::getImageServingUrl($full_path_photo);

// And adding this before the call:
CloudStorageTools::deleteImageServingUrl($full_path_photo);


When I run this, I get the "Getting URL...", then nothing. The page just stops executing.










share|improve this question






















  • You should try-catch your code to see if any exception is throwed. Following the doc, it may throw a InvalidArgumentException or a googleappengineapicloud_storageCloudStorageException
    – Tom Ah
    Nov 11 at 22:46










  • I was thinking that somewhere in the last four hours I had tried that, but doing it this time did produce a result - "Unspecified error with image". The error is kind of a let down, but better than nothing.
    – fitz
    Nov 11 at 23:26













up vote
0
down vote

favorite









up vote
0
down vote

favorite











This a php application running on Google App Engine. I'm using getImageServingUrl to get a url and store it for later use. I've actually implemented this in another part of the application, but in this case, when run, the php code stops right at the point where I make the call to get the url. The are no errors in the page or in the App Engine log. Is there another place to get errors? I'm not having luck tracking down the issue. Here's what I have:



// At the top of the page I call this
use googleappengineapicloud_storageCloudStorageTools;

// Some processing takes place to get the storage location of the image then
if (is_file($full_path_photo)) {

echo 'Getting URL...<br>';
$object_public_url = CloudStorageTools::getImageServingUrl($full_path_photo, ['secure_url' => true]);
echo 'Successful<br>';
};

// I've also tried it like this:
$object_public_url = CloudStorageTools::getImageServingUrl($full_path_photo);

// And adding this before the call:
CloudStorageTools::deleteImageServingUrl($full_path_photo);


When I run this, I get the "Getting URL...", then nothing. The page just stops executing.










share|improve this question













This a php application running on Google App Engine. I'm using getImageServingUrl to get a url and store it for later use. I've actually implemented this in another part of the application, but in this case, when run, the php code stops right at the point where I make the call to get the url. The are no errors in the page or in the App Engine log. Is there another place to get errors? I'm not having luck tracking down the issue. Here's what I have:



// At the top of the page I call this
use googleappengineapicloud_storageCloudStorageTools;

// Some processing takes place to get the storage location of the image then
if (is_file($full_path_photo)) {

echo 'Getting URL...<br>';
$object_public_url = CloudStorageTools::getImageServingUrl($full_path_photo, ['secure_url' => true]);
echo 'Successful<br>';
};

// I've also tried it like this:
$object_public_url = CloudStorageTools::getImageServingUrl($full_path_photo);

// And adding this before the call:
CloudStorageTools::deleteImageServingUrl($full_path_photo);


When I run this, I get the "Getting URL...", then nothing. The page just stops executing.







php google-app-engine






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 11 at 22:39









fitz

123




123












  • You should try-catch your code to see if any exception is throwed. Following the doc, it may throw a InvalidArgumentException or a googleappengineapicloud_storageCloudStorageException
    – Tom Ah
    Nov 11 at 22:46










  • I was thinking that somewhere in the last four hours I had tried that, but doing it this time did produce a result - "Unspecified error with image". The error is kind of a let down, but better than nothing.
    – fitz
    Nov 11 at 23:26


















  • You should try-catch your code to see if any exception is throwed. Following the doc, it may throw a InvalidArgumentException or a googleappengineapicloud_storageCloudStorageException
    – Tom Ah
    Nov 11 at 22:46










  • I was thinking that somewhere in the last four hours I had tried that, but doing it this time did produce a result - "Unspecified error with image". The error is kind of a let down, but better than nothing.
    – fitz
    Nov 11 at 23:26
















You should try-catch your code to see if any exception is throwed. Following the doc, it may throw a InvalidArgumentException or a googleappengineapicloud_storageCloudStorageException
– Tom Ah
Nov 11 at 22:46




You should try-catch your code to see if any exception is throwed. Following the doc, it may throw a InvalidArgumentException or a googleappengineapicloud_storageCloudStorageException
– Tom Ah
Nov 11 at 22:46












I was thinking that somewhere in the last four hours I had tried that, but doing it this time did produce a result - "Unspecified error with image". The error is kind of a let down, but better than nothing.
– fitz
Nov 11 at 23:26




I was thinking that somewhere in the last four hours I had tried that, but doing it this time did produce a result - "Unspecified error with image". The error is kind of a let down, but better than nothing.
– fitz
Nov 11 at 23:26












1 Answer
1






active

oldest

votes

















up vote
0
down vote













Try/Catch was able to get an error message for this one. In my case it was kind of a generic error. For the overall issue I think has something to do with my buckets. I tried the whole thing with a different bucket and it seems to work. Here is the example -



// At the top of the page I call this
use googleappengineapicloud_storageCloudStorageTools;

// Some processing takes place to get the storage location of the image in GCP storage then
if (is_file($full_path_photo)) {

try {

$object_public_url = CloudStorageTools::getImageServingUrl($full_path_photo, ['secure_url' => true]);
throw new Exception();

} catch (Exception $e) {
echo 'Error: '.$e->getMessage().'<br>';
};


Thanks for the help Tom.






share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53253962%2fis-there-a-way-to-grab-errors-for-google-app-engines-getimageservingurl%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    Try/Catch was able to get an error message for this one. In my case it was kind of a generic error. For the overall issue I think has something to do with my buckets. I tried the whole thing with a different bucket and it seems to work. Here is the example -



    // At the top of the page I call this
    use googleappengineapicloud_storageCloudStorageTools;

    // Some processing takes place to get the storage location of the image in GCP storage then
    if (is_file($full_path_photo)) {

    try {

    $object_public_url = CloudStorageTools::getImageServingUrl($full_path_photo, ['secure_url' => true]);
    throw new Exception();

    } catch (Exception $e) {
    echo 'Error: '.$e->getMessage().'<br>';
    };


    Thanks for the help Tom.






    share|improve this answer

























      up vote
      0
      down vote













      Try/Catch was able to get an error message for this one. In my case it was kind of a generic error. For the overall issue I think has something to do with my buckets. I tried the whole thing with a different bucket and it seems to work. Here is the example -



      // At the top of the page I call this
      use googleappengineapicloud_storageCloudStorageTools;

      // Some processing takes place to get the storage location of the image in GCP storage then
      if (is_file($full_path_photo)) {

      try {

      $object_public_url = CloudStorageTools::getImageServingUrl($full_path_photo, ['secure_url' => true]);
      throw new Exception();

      } catch (Exception $e) {
      echo 'Error: '.$e->getMessage().'<br>';
      };


      Thanks for the help Tom.






      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        Try/Catch was able to get an error message for this one. In my case it was kind of a generic error. For the overall issue I think has something to do with my buckets. I tried the whole thing with a different bucket and it seems to work. Here is the example -



        // At the top of the page I call this
        use googleappengineapicloud_storageCloudStorageTools;

        // Some processing takes place to get the storage location of the image in GCP storage then
        if (is_file($full_path_photo)) {

        try {

        $object_public_url = CloudStorageTools::getImageServingUrl($full_path_photo, ['secure_url' => true]);
        throw new Exception();

        } catch (Exception $e) {
        echo 'Error: '.$e->getMessage().'<br>';
        };


        Thanks for the help Tom.






        share|improve this answer












        Try/Catch was able to get an error message for this one. In my case it was kind of a generic error. For the overall issue I think has something to do with my buckets. I tried the whole thing with a different bucket and it seems to work. Here is the example -



        // At the top of the page I call this
        use googleappengineapicloud_storageCloudStorageTools;

        // Some processing takes place to get the storage location of the image in GCP storage then
        if (is_file($full_path_photo)) {

        try {

        $object_public_url = CloudStorageTools::getImageServingUrl($full_path_photo, ['secure_url' => true]);
        throw new Exception();

        } catch (Exception $e) {
        echo 'Error: '.$e->getMessage().'<br>';
        };


        Thanks for the help Tom.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 12 at 0:25









        fitz

        123




        123






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53253962%2fis-there-a-way-to-grab-errors-for-google-app-engines-getimageservingurl%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Bressuire

            Vorschmack

            Quarantine