def build_api_error(message, **kwargs):
 return {'developer_message': message.format(**kwargs), 'user_message': _(message).format(**kwargs)}

def build_api_error ( message , ** kwargs ) : return { 'developer_message' : message . format ( ** kwargs ) , 'user_message' : _ ( message ) . format ( ** kwargs ) }
build an error dict corresponding to edx api conventions .