Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Jan 2011
    Posts
    3

    Default unable to display an error with $Cpanel::CPERROR{$Cpanel::context}

    Update: This seems to be an issue in 11.28.87 and 11.30.1

    Hey, Ive been using the CustomEventHandler.pm to tap into various api and deny certain actions - in this example the cron::add_line call.

    What im trying to achieve here is - if a user tries to add a cron which runs with a frequency less than 15 mins,
    I want to throw an error on the page..

    Heres the snippet
    if ( $module eq 'cron' && $event eq 'add_line' ){
    my $logger = Cpanel::Logger->new({ alternate_logfile => "/var/tmp/cpanel_api_install.log" });
    $logger->info("$apiv, $type, $module, $event");
    my $cron_minute = $cfgref->{'minute'};
    if ( $cron_minute =~ /\*/){
    $logger->info(Dumper($cfgref->{'minute'}));
    $CPanel::CPERROR{$Cpanel::context} = "[fail]";
    return;
    }

    return 1;
    }
    While the evenhandler works perfect, cron is prevented from being added, I don't get the message displayed on the page which Ive defined - $CPanel::CPERROR{$Cpanel::context} = "[fail]";

    Instead I see an error box with
    Error
    JSON parse failed.
    - Am I missing something out?
    - Is there a better way to do what im trying to
    - Is there any hack I could implement to display the message


    Thanks,
    Joel
    Last edited by smooth_p; 07-21-2011 at 09:59 AM.

  2. #2
    Integration Developer cPanelDavidN's Avatar
    Join Date
    Dec 2009
    Location
    Houston, TX
    Posts
    525

    Default Re: unable to display an error with $Cpanel::CPERROR{$Cpanel::context}

    Hi Joel,

    I'm able to reproduce this and need to investigate it further. ATM, I'm not sure if it's a systemic problem or just isolated to this call. Are you experiencing this on other API2 calls as well?

    Thanks,
    -DavidN
    David Neimeyer
    Integration Developer

    sdk.cpanel.net
    APIs: XML-API API1 & API2
    Check Out: Developer Downloads Integration Blog
    Need Support? Support Ticket Developer Forum Feature Request

  3. #3
    Registered User
    Join Date
    Jan 2011
    Posts
    3

    Default Re: unable to display an error with $Cpanel::CPERROR{$Cpanel::context}

    Hey,

    Thanks for your reply! well Ive been using it for the 'SSL' api and haven't been having any trouble there..
    If theres any specific API call you'd like me test let me know.. Also is there a fix I could try out without having to upgrade

    Thanks again,
    Joel

  4. #4
    cPanel Staff cPanelMatt's Avatar
    Join Date
    Apr 2005
    Location
    Houston, TX
    Posts
    409

    Default Re: unable to display an error with $Cpanel::CPERROR{$Cpanel::context}

    This is a bug with the JS code on that page.

    We have located the source of the issue and are working on a resolution currently.

    Thanks for your patience.
    Matt Dees
    Integration Developer
    cPanel, Inc.
    cPanel Integration Blog

Similar Threads & Tags
Similar threads

  1. Error Unable to fetch the cPanel user file for
    By Ahmed Abozaid in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 07-18-2011, 12:52 PM
  2. Horde unable to display contact list
    By webdev in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 06-12-2006, 10:40 AM
  3. Cpanel upgrade unable to connect error
    By tgibobby in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 06-28-2005, 07:08 AM
  4. mod_rewrite, in a cPanel context
    By curioususer in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 05-08-2005, 07:21 PM
  5. Replies: 1
    Last Post: 10-21-2003, 06:08 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube