Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Referenced resp before assignment #71

Open
parteekcoder opened this issue May 12, 2023 · 3 comments
Open

Referenced resp before assignment #71

parteekcoder opened this issue May 12, 2023 · 3 comments

Comments

@parteekcoder
Copy link
Contributor

In the main.py, at the build method resp is returned as a response. But it can be the case when it is not get assigned by any value because they are inside the if block

@parteekcoder
Copy link
Contributor Author

2023-05-12 05:22:20,426: Exception on /build/test [POST]
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 2077, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1525, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/parteek/.local/lib/python3.10/site-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1523, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1509, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/home/parteek/concore/fri/server/main.py", line 101, in build
return resp
UnboundLocalError: local variable 'resp' referenced before assignment

@Rahuljagwani
Copy link
Contributor

Hi @parteekcoder
I found out that this error arises if some user executed a build on any particular graphml, and forgot to destroy it. When the same graphml file will be executed by user, this error will come as the directory_path created already exists https://github.com/ControlCore-Project/concore/blob/main/fri/server/main.py#LL80C37-L80C37,
what u think can be done to solve this? I mean what can be the generic response if an already existing directory is tried to build again?

@parteekcoder
Copy link
Contributor Author

@Rahuljagwani I think we send message something like 'directory already exists' or can discuss

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants