Re: Review Board Ticket #4722: ssssh review board is taking a nap after install

2018-07-19 Thread Achim Munene
--
To reply, visit https://hellosplat.com/s/beanbag/tickets/4722/
--

New update by kimo
For Beanbag, Inc. > Review Board > Ticket #4722


Reply:

hello thank you i managed to view the logs and its a issue with 
DistributionNotFound: The 'python-memcached' distribution was not found but i 
have it installed

-- 
You received this message because you are subscribed to the Google Groups 
"reviewboard-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard-issues+unsubscr...@googlegroups.com.
To post to this group, send email to reviewboard-issues@googlegroups.com.
Visit this group at https://groups.google.com/group/reviewboard-issues.
For more options, visit https://groups.google.com/d/optout.


Re: Djblets Ticket #4723: Djblets should allow decorated methods to use exceptions for response errors

2018-07-19 Thread David Trowbridge
--
To reply, visit https://hellosplat.com/s/beanbag/tickets/4723/
--

New update by jcannon
For Beanbag, Inc. > Djblets > Ticket #4723


Reply:

That seems like it's probably a niche use-case. It might be better to just 
have your own exception handler:

```python
class FieldException(Exception):
...


class MyResource(WebAPIResource):
@webapi_response_errors(INVALID_FORM_DATA):
@webapi_request_fields(...)
def create(self, data1, data2):
try:
data1 = self._helper(data1)
data2 = self._helper(data2)
return 201, {...}
except FieldException as e:
return INVALID_FORM_DATA, {...}

def _helper(self, data):
if 'my_key' not in data:
raise FieldError(...)
```

-- 
You received this message because you are subscribed to the Google Groups 
"reviewboard-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard-issues+unsubscr...@googlegroups.com.
To post to this group, send email to reviewboard-issues@googlegroups.com.
Visit this group at https://groups.google.com/group/reviewboard-issues.
For more options, visit https://groups.google.com/d/optout.


Re: Djblets Ticket #4723: Djblets should allow decorated methods to use exceptions for response errors

2018-07-19 Thread Joshua Cannon
--
To reply, visit https://hellosplat.com/s/beanbag/tickets/4723/
--

New update by jcannon
For Beanbag, Inc. > Djblets > Ticket #4723


Reply:

`decorators.py` is `djblets/webapi/decorators.py` and is just the relvant 
djblits module.
Example is:

```python
class MyResource(WebAPIResource):
   # ...
   @webapi_response_errors(INVALID_FORM_DATA)
   @webapi_request_fields(...)
   def create(self, data1, data2):
  data1 = self._helper(data1)
  data2 = self._helper(data2)
  return 201, {...}
  
   def _helper(self, data):
  if 'my_key' not in data:
 # I can't return the error here, or else the caller would
 # need to check for it.
 # It would be nice if I could raise ResponseError(INVALID, ...)
 # Or even better, rase InvalidFormData(...)
 error()
  return {...}
```

-- 
You received this message because you are subscribed to the Google Groups 
"reviewboard-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard-issues+unsubscr...@googlegroups.com.
To post to this group, send email to reviewboard-issues@googlegroups.com.
Visit this group at https://groups.google.com/group/reviewboard-issues.
For more options, visit https://groups.google.com/d/optout.


Re: Djblets Ticket #4723: Djblets should allow decorated methods to use exceptions for response errors

2018-07-19 Thread David Trowbridge
--
To reply, visit https://hellosplat.com/s/beanbag/tickets/4723/
--

New update by jcannon
For Beanbag, Inc. > Djblets > Ticket #4723


Reply:

Which decorators.py are you talking about? And which decorator methods 
inside of that?

It might be helpful to see an example of what you're looking to do.


Status:
- New
+ NeedInfo

-- 
You received this message because you are subscribed to the Google Groups 
"reviewboard-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard-issues+unsubscr...@googlegroups.com.
To post to this group, send email to reviewboard-issues@googlegroups.com.
Visit this group at https://groups.google.com/group/reviewboard-issues.
For more options, visit https://groups.google.com/d/optout.


Djblets Ticket #4723: Djblets should allow decorated methods to use exceptions for response errors

2018-07-19 Thread Joshua Cannon
--
To reply, visit https://hellosplat.com/s/beanbag/tickets/4723/
--

New ticket #4723 by jcannon
For Beanbag, Inc. > Djblets

Status: New
Tags: Priority:Medium, Type:Enhancement


--
Djblets should allow decorated methods to use exceptions for response errors
==

# What version are you using?
master

# Which module(s) does this relate to?
decorators.py

# Describe the enhancement and the motivation for it.
I have a decorated method that might respond with some errors, but those errors 
are generated in a helper method. There's no natural way for me to write the 
helper method to return error-or-data.
The decorated method should be able to `raise djblets.ResponseError(err, info)` 
to mean error, and just return `info` (which it turns into `(201, info)`).

This would greatly improve the code flow of the decorated methods.

# Please provide any additional information below.


--

-- 
You received this message because you are subscribed to the Google Groups 
"reviewboard-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard-issues+unsubscr...@googlegroups.com.
To post to this group, send email to reviewboard-issues@googlegroups.com.
Visit this group at https://groups.google.com/group/reviewboard-issues.
For more options, visit https://groups.google.com/d/optout.