Questions tagged [error-handling]

1

votes
1

answer
37

Views

Python 3.6: Using object instance name for raising errors

I'm attempting to create a 3-d graphics engine using Python 3.6, Tkinter, and specifically NOT pygame (or any other 3d graphics engines) as part of a university assignment. Within this project, I have had to create a 'matrix' class, which allows me to easily create and manipulate mxn matrices. I bel...
William Pulford
1

votes
1

answer
54

Views

Accept */* error in classic asp pages

I had to move my site to a different server, so I believe it has to do with the different server setup. I use a Asp Classic. I have a code to trap errors and email them to me. All the pages load fine and have no issues form a client side. I'm receiving the email with the following error mess...
H.L.
1

votes
1

answer
38

Views

Using python3 to show bigrams of a (tokenized) text results in a broken pipe error

My code: import sys def byFreq(pair): return pair[1] def main(): bigrams = {} for line in sys.stdin: line = line.lower() words = line.split() for i in range (len(words)-1): bigram = (words[i],words[i+1]) bigrams[bigram] = bigrams.get(bigram,0) + 1 bigrams = list(bigrams.items()) bigrams.sort(key=byF...
Thijmen Dam
1

votes
0

answer
297

Views

How to display error messages on a page Angular 2

I am trying to use http interceptor to add headers with the http request and it's working fine. Now I want to display the error messages on the page. So Is there any way to show error messages using the http interceptor? I have no idea how to show error messages on a page. Sample: InterceptorService...
Aakriti.G
1

votes
1

answer
438

Views

Error in svd(X) : infinite or missing values in 'x' . when using BacktestVaR in GAS

I want to use BacktestVaR function in GAS package the data file is here returns returns1
Sulthan
1

votes
0

answer
621

Views

Error in `python3': free(): invalid pointer

I'm trying to read all the csv files in 2 directories using glob module: import os import pandas as pd import glob def get_list_of_group_df(filepath): all_group_df_list = [] groups_path = filepath for file in glob.glob(groups_path): name = os.path.basename(file) name = patient_name.partition('_raw')...
Bella
1

votes
1

answer
716

Views

model.fit() generates ERROR: ValueError: All input arrays (x) should have the same number of samples

I have a keras model with several custom layers. When I run: model_.compile(optimizer=rms, loss=contrastive_loss,metrics=['accuracy']) It compiles without any problems. But when I try to fit the model with a list of arrays: X = [T1,R1] + [T2, R2] model_.fit(X, [None]*2, epochs=50, batch_size=32) I...
Tassou
1

votes
1

answer
678

Views

How to handle HTTP Status Codes across a Python application?

I'm trying to standardize my handling of HTTP status codes returned from various APIs in an effort to reduce the amount of code I copy across files. For my current application, I have a set of files that each contain one class that all derive inheritance from one master class. I'm using the Python...
Michael Bianchi
1

votes
0

answer
127

Views

Python MySQL Connector: Why do I get different error messages depending on user for the same error?

I am connecting to a mysql database to get some data. It works fine, but I am trying to build in error checking in the event something goes wrong. Here is the test code (without error checking): conn = mysql.connector.connect( user='pool', password='password', host='127.0.0.1', database='emsdb') con...
Richard
1

votes
0

answer
43

Views

By trying to put a filename with [chunkhash] in webpack, returns an error

By using filename: dev ? '[name].js' : '[name].[chunkhash:8].js', in webpack.config.js (in prod), i got the error ERROR in chunk manifest [entry] [name][chunkhash:8].js Cannot use [chunkhash] for chunk in '[name][chunkhash:8].js' (use [hash] instead) How should I use chunkhash correctly? https://gis...
CHARLOT alexandre
1

votes
1

answer
22

Views

How to convert non-numeric values to blank for use in case statement?

I am working on the following query: declare @start date = '06/01/2016'; declare @end date = '07/31/2017'; ----------------------------------------------------------------------------- ------------------------------------------------ -- Pull all claims with paid date in range parameter --------...
G SQL
1

votes
1

answer
155

Views

Safest way to unwrap optionals

I finished coding my app and now is time to add safety features to prevent crashes. I didn't implement a correct nil handling yet, testing revealed a few crashes from fetching no data from the API. My structure is a little complex and I lost myself trying to implement the security thing so I would...
Wizzardzz
1

votes
0

answer
57

Views

Downloading ImageURL from Firebase

I have a swift project that is storing data and an image in Firebase.I am looking to pass an image which loads successfully in my uitableview from the tableviewcell to another uiviewcontroller. I am using the following function and then calling that function in viewdidload: func downloadImg() { let...
Rob
1

votes
1

answer
252

Views

Dealing with ConcurrentAccessTimeoutException in asynch methods

With rest service a long running process is triggered. It makes no sense to run it in parallel, the main service is defined as Singleton with default concurrency management strategy. In rest, a response is sent immediately, just for notification, that it has been triggered. To archive it the method...
Alexandr
1

votes
0

answer
140

Views

Handle Azure web app timeout error to send ApplicationInsights traces

We have a webapi wep app deployed in Azure. We receive a POST request that takes longer that 230 seconds to finish. Azure is then killing the request and sending a 500 error response. My problem is that all Application Insights telemetry and error traces for that POST request are lost when the requ...
Diana
1

votes
0

answer
41

Views

Assertion error in mvc test

Have a class like and keep getting no model and view @AutoConfigureMockMvc @RunWith(SpringRunner.class) @WebMvcTest(value = HomeController.class, secure = false) @ContextConfiguration( classes = {SecurityConfig.class}) @EntityScan(basePackages = {'com.valentine.bookstore', 'com.valentine.service',...
valen ezu
1

votes
1

answer
115

Views

JSON Parser Python Script Issues

I'm a first year student in CS, attempting to debug a simple Python script. The script is attempting to parse a directory of JSON files, aka an AWS bucket. I can't figure out where these errors come from, however: import json import os from pprint import pprint jsonDirectory = '/path/to/dir/' targ...
Steve8302
1

votes
1

answer
3k

Views

Angular 5 Custom-Error-Handler: Display Error-message

I'm trying to create an error-handler for Angular 5. If an error is fired through my CustomErrorHandler, the frontend should be updated. The problem is that nothing changes, after the variable is updated. error-handler.service.ts import {ErrorHandler, Injectable} from '@angular/core'; import {Subje...
Peter Horitzer
1

votes
0

answer
82

Views

Parameter validation behaves inconsistently when piping data

I'm curious why there's a difference in the parameter validation between piped arguments and non piped arguments in terms of terminating or non terminating errors. Some code to explain. Test function: Function Test-Foo { Param ( [Parameter(Mandatory)] [ValidateScript({Test-Path -Path $_ -PathType Co...
DarkLite1
1

votes
1

answer
44

Views

AttributeError: decoding error while running Python tweepy script in Ubuntu

I have a Python 3.5 script which essentially is a Twitter scraper that collects tweets using the tweepy package and its StreamListener function. Now my script runs perfectly within the Command shell but when I try to run it on the Ubuntu environment of my server I receive a decoding error. File '/...
Oliver
1

votes
1

answer
67

Views

Handle Key-Error whilst scraping

I am currently working on a script to scrape data from ClinicalTrials.gov. To do this I have written the following script: def clinicalTrialsGov (id): url = 'https://clinicaltrials.gov/ct2/show/' + id + '?displayxml=true' data = BeautifulSoup(requests.get(url).text, 'lxml') studyType = data.study_ty...
jdeo
1

votes
1

answer
793

Views

Oracle Apex error handling

I have a textbox (tb_pcode) that user must enter the personnel code. This is a part of my code : declare n varchar2(20); begin select name into n from pers e where e.pcode = :tb_pcode; exception when no_data_found then apex_error.add_error ( p_message => 'No person found!', p_display_locat...
Professor
1

votes
1

answer
326

Views

How to handle: java.lang.ArrayIndexOutOfBoundsException: 1

I have a program that takes in a file of unindented code and comments the program takes the specified file and will output an indented version of the code. I keep on getting the java.lang.ArrayIndexOutOfBoundsException: 1 error. This seems to occur when I have only one comment on a line as for when...
J.Rogers
1

votes
1

answer
45

Views

Swift3 how to catch all exceptions?

I'm debugging a table view in Swift3 and it complains about the number of rows. Because I know of no way to catch this exception, I'm forced to re-launch the project every time. How do I catch swift exceptions which do not throw errors, like the table view example below? do { self.tableView.reload...
Alex Stone
1

votes
1

answer
272

Views

Instamojo payment gateway error

After I checkout choosing instamojo as my payment option, the following error shows up. I filled in the email field in the billing details and yet, it shows up. How do I fix this? Notice: Undefined index: email in /home/thecoxiy/public_html/catalog/controller/payment/instamojo.php on line 42 /This i...
stackingupmyproblems
1

votes
1

answer
41

Views

catching exceptions while waiting for a promise in nodejs

I am writing a library in nodejs, that is wrapping another library. my code is something like this: function wrapper(functionToWrap) { return function(param1, param2) { try { return functionToWrap(param1, param2); } catch(err) { console.log(err); throw err; } finally { finalizeWrapping(); } } } the...
Gal Bashan
1

votes
0

answer
125

Views

How to suppress verbose error message in powershell?

Please, observe: And here is the transcript: PS C:\Dayforce\854\db\SQL\ClientDB> $job = Start-Job { C:\Dayforce\854\db\tools\dbupgrade\DbUpgrade.exe -d C:\Dayforce\854\db\SQL\ClientDB -db 854_dfadminportal } PS C:\Dayforce\854\db\SQL\ClientDB> C:\Dayforce\854\db\tools\dbupgrade\DbUpgrade.exe -d C:\D...
mark
1

votes
0

answer
379

Views

OpenCV was not initialized correctly. Application will be shut down

I am trying to upload a photo from my phone and do linear filtering on it. But I get that error message. these are my program's files: Manifest: MainActivity: package com.m.opencvjava; public class MainActivity extends AppCompatActivity { private final int SELECT_PHOTO = 1; private ImageView ivImage...
user3486308
1

votes
0

answer
15

Views

AVD crashes after moved android/sdk file from C:/user/myuser/appdata/local to E:/android/sdk

I had low space on my C drive so I copied the .appdata/local/android/sdk file to E drive and edited the path in my android studio. But my AVD now looks like this:
user3486308
1

votes
0

answer
126

Views

Python. Raise exception from multiple exceptions

I can raise an exception from another exception in order to provide additional information, e.g.: try: age = int(x) except Exception as ex: raise ValueError('{} is not a valid age.'.format(x)) from ex Is there any way to source from multiple exceptions? e.g. try: age = int(x) except Exception as ex1...
c z
1

votes
2

answer
218

Views

Throw timeout exception from SOAPException

I am trying to throw a timeout exception in the code below. I tried a simple condition but it's not the proper way. My question is how can I distinct the timeout exception from SOAPException? URL endpoint = new URL(null, urlStr, new URLStreamHandler() { // The url is the parent of this stream handle...
pik4
1

votes
1

answer
38

Views

How can I catch any output to the console from a Python Tkinter application?

I have a large, multifile, Tkinter app with innumerable functions, that is then being packaged with Pyinstaller as an executable. It contains error handling for expected events. However, it does not have any error handling for unexpected events. When running the application before packaging it as an...
user1318135
1

votes
1

answer
52

Views

How to raise an Error for the completionHandler?

I'm in process of unittesting a case where the completionHandler is throwing an error. But I'm not sure how to raise that error. class MockErrorSession: URLSessionProtocol { var nextDataTask = MockURLSessionDataTask() var nextData: Data? var nextError: Error? func dataTask(with request: NSURLReques...
Houman
1

votes
0

answer
42

Views

bubbling up errors in service objects to controllers

I have a service object that calls to an external service(Service::Customer) like following class CustomerService def initialise(params) @email = params[:email] end def save_customer Service::Customer.create(@email) end end my controller contains a create method class CustomersController < Applicati...
Shani
1

votes
1

answer
33

Views

Copy & Paste error “Action can't work on multiple sections”

I am trying to paste the filtered results another column in the corresponding cells. When I try to paste I get the error 'Action can't work on multiple sections'. Any idea how to fix the code? LRow = Ws1.Range('CJ' & Rows.Count).End(xlUp).Row Set PasteRng = Ws1.Range('F1:F' & LRow).SpecialCells(xlC...
papacoolaid666
1

votes
1

answer
274

Views

Webpack global JS error handler and “Script error”

I have a react project build with Webpack. There is an error (most likely a missing JS feature, but it's just a guess), that only reveals itself in 'fetch as Google', whatever browser/JS engine they're using in this tool. Obviously I don't have a console or other means to get an error, other than w...
Oleg Shemetov
1

votes
0

answer
171

Views

Angular Firestore - How to handle errors retrieving data

I've used firestore in various components to output data from collections and documents with both snapshotChanges() and subscribe() methods, but this pretty much relies on data being present, and doesn't look to handle any errors, for example when data is not found or there is an error retrieving it...
nick.cook
1

votes
1

answer
32

Views

PHP Webhost Operation Checking

I wanted perform checking if the PHP Webhost is complete whenever perform a update function, if everything doing fine then send an notification and let the Application know the Operation is Doing fine. Basically I wanted to know if the query in PHP work and use my application to notify the user. is...
AndroidLover
1

votes
0

answer
165

Views

Using services from ModuleWithProviders inside ErrorHandler

This one is bit of a pain and has had me stumped for a while now. Hoping you can help! I have a module UICoreModule which houses a bunch of components, services etc. The services are provided via the ModuleWithProviders approach, as it gets bundled and published to npm. I'm implementing a global e...
Steve D
1

votes
2

answer
45

Views

detecting empty child arrays - invalid foreach

I'm trying to grab the NS and A records for a list of domains I have in a table. I've started to write this: $domains = GetDomainsForDNS(); foreach ($domains as $domain){ $domain_id = $domain[0]; $domain = $domain[1]; $dns_records = dns_get_record($domain, DNS_NS + DNS_A); echo $domain; foreach($dns...
Ste Hughes

View additional questions