In my logs I have one Facebook API exception and I don't find any information about it. Anybody knows this?
The Exception is:
[error] => Array
(
[message] => Unable to get 'r' connection to tier cdb.dfs
[type] => DataLayerException
)
Related
I am implementing a GET request which needs to interact with an ERP and extract employee details .
Now the interaction with ERP is not using HTTP so it does not return status codes such as 400 etc
Any error if present is returned in the XML payload response .
Example:
<?xml version="1.0" encoding="utf8" ?>
<Output>
<Error>
<Status>0</Status>
<Details>No errors</Details>
</Error>
</Output>
So I have implemented it this way - where after calling ERP and receiving response I check if response contains any error ( errorCode = 0 means an error otherwise all good )
If not an error normal processing , if an error I simply set the http status to 400 and populate response with error details.
Question:
In the error flow I am NOT throwing any exception / error and simply returning a response with 400 response status and error details .
My gut feel is in this case there is no need to Raise error ( throw ) and then again catch it in error handler.
I thought it is unnecessary in this case but was looking for some feedback ?
Note - the exception handler below is meant to catch errors such as ERP is down / unavailable etc
Note - as this is more a design / approach question , am only pasting screen print of the flow and not the actual code
Please do share your feedback and suggestions
There is no mandate to use Mule Error handling to return an HTTP status, if that's your question.
Note that Mule 4 uses error handling, not exception handling, though it looks similar.
Unrelated, it is strange that you are using HTTP status 400 for a server error, when 400 is meant for bad client request. You may want to use a more proper status.
I am attempting to assign a Task using the Podio API to a guest user.
I can do this easily through the Podio Web Interface (I do it all the time) but why can't I do this with the API?
Here is my basic code:
$resp_profiles[] = array(
'type' => 'profile',
'id' => 4346424);
PodioTask::create(array(
'text' => $subTitle,
'description' => $subTitle,
'private' => false,
'due_on' => $task_due_date->format('Y-m-d H:i:s'),
'responsible' => $resp_profiles,
));
Here is the error I get:
Fatal error: Uncaught PodioForbiddenError:
"Must be at least light on user 4346424 to perform this operation"
Request URL: http://api.podio.com/task/
Stack Trace:
#0 /home/avcorp/vhosts/pubvps/vendor/podio/podio-php/lib/Podio.php(352): Podio::request('POST', '/task/', Array, Array)
#1 /home/avcorp/vhosts/pubvps/vendor/podio/podio-php/models/PodioTask.php(78): Podio::post('/task/', Array)
#2 /home/avcorp/vhosts/pubvps/podio_rmticket/rmticket_util.php(309): PodioTask::create(Array)
#3 /home/avcorp/vhosts/pubvps/podio_rmticket/rmticket_util.php(152): rmtCreateTask(Object(AvcPodioItem), 'Carpet Cleaning', 10, 3)
#4 /home/avcorp/vhosts/pubvps/podio_rmticket/poll/rmticket_poll.php(54): test_task_creation()
#5 {main} thrown in /home/avcorp/vhosts/pubvps/vendor/podio/podio-php/lib/Podio.php on line 319
From Podio help page: https://help.podio.com/hc/en-us/articles/201019898-Member-roles-in-workspaces
Guests are users that have been invited to selected items using the
share item tool. They can edit and comment these specific items, but
cannot see anything else within the workspace, such as the full list
of members, other information in the app, or other apps in the same
workspace.
Have you tried changing role to 'Light' ?
That will also explain error message: Must be at least light on user 4346424 to perform this operation
You cannot assign a task to guest user profile even from frontend. It might be a bit confusing because you can assign task to user using mail user identifier, but that is restricted to Podio highly trusted partners only.
We are getting an error when running a query job on BigQuery :
'message' => 'Request timed out. Please try again.',
'reason' => 'timeout',
'location' => 'script'
We will be running it again as it requested, but since it takes 1/2 hour for it to time out, it would be helpful if we knew what the problem is so we can avoid it.
Specifically:
What does "script" mean in this context? Is it the SQL-query or one
of the UDFs? (the query calls 3 UDFs).
The exact same query failed twice already with "internal error". The "request timed out" was its 3rd attempt at mocking us. Any correlation between the two error types?
It would be really helpful to receive more detailed information on what failed to work, so that we can track it down.
I am performing a GET request in Ruby and not sure why I am sometimes getting the following stack trace.
RestClient::MethodNotAllowed: 405 Method Not Allowed
[GEM_ROOT]/gems/rest-client-1.6.8/lib/restclient/abstract_response.rb:48:in return!
[GEM_ROOT]/gems/rest-client-1.6.8/lib/restclient/request.rb:269:in process_result
[GEM_ROOT]/gems/rest-client-1.6.8/lib/restclient/request.rb:212:in block in transmit
/usr/lib/ruby/2.0.0/net/http.rb:852:in start
[GEM_ROOT]/gems/rest-client-1.6.8/lib/restclient/request.rb:206:in transmit
[GEM_ROOT]/gems/rest-client-1.6.8/lib/restclient/request.rb:68:in execute
[GEM_ROOT]/gems/rest-client-1.6.8/lib/restclient/request.rb:35:in execute
[GEM_ROOT]/gems/rest-client-1.6.8/lib/restclient.rb:70:in get
It's especially confusing because the stack trace does not say which method is not allowed. What might be the cause of this error?
You could try to rescue the exception. This way you can access the http_body of the response. If you're lucky, this might give you an insight on what went wrong.
begin
RestClient.get 'http://example.com/resource', {:params => {:id => 50, 'foo' => 'bar'}}
rescue RestClient::Exception => e
puts e.http_body
end
Iam using delayed job in a rails application. I want to notify an error to airbake whenever a delayed job fails. I checked on github and leant about the failure method.
I want to send the last_error attribute of failed delayed job to airbrake. Something like this:
class ParanoidNewsletterJob < NewsletterJob
def perform
end
def failure
Airbrake.notify(:message => self.last_error, :error_class => self.handler)
end
end
But it gives me the following runtime error:
undefined method `last_error' for #<struct ParanoidNewsletterJob>
Please help me figure out how I can notify Airbrake the last_error of a failed delayed_job.
Many Thanks!!
You should be able to pass the job to the failure method, and then extract the last_error from the job. i.e.
def failure(job)
Airbrake.notify(:message => job.last_error, :error_class => job.handler)
end
this should work fine
def failure(job)
Airbrake.notify(:message => job.error, :error_class => job.error.class, :backtrace => job.error.backtrace)
end
There are two ways you can achieve what you want:
A job specific method which only applies to the type of job you want by implementing the failure method with the job as the parameter. The job will contain error and last_error. And this is what other answers are about.
A global option where a plugin can be developed to apply it to any job type created. This is desired if all jobs need to be monitored. The plugin can be registered and perform actions around various events in the lifecycle of a job. For example, below is a plugin to update the last_error if we want to process it before storing to database
One example below:
require 'delayed_job'
class ErrorDelayedJobPlugin < Delayed::Plugin
def self.update_last_error(event, job)
begin
unless job.last_error.nil?
job.last_error = job.last_error.gsub("\u0000", '') # Replace null byte
job.last_error = job.last_error.encode('UTF-8', invalid: :replace, undef: :replace, replace: '')
end
rescue => e
end
end
callbacks do |lifecycle|
lifecycle.around(:failure) do |worker, job, *args, &block|
update_last_error(:around_failure, job)
block.call(worker, job)
end
end
end
Basically it will be called when any failure occurs for any job. For details on how this callback thing work, you can refer to A plugin to update last_error in Delayed Job.