File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313# limitations under the License.
1414
1515from __future__ import print_function
16+ from googleapiclient import errors
17+
1618
1719class ClassroomSnippets (object ):
1820 def __init__ (self , service ):
19- self .service = service
21+ self .service = service
2022
2123 def add_alias_new (self ):
2224 """
23- Creates a course with alias specification.
25+ Creates a course with alias specification.
2426 """
2527 service = self .service
2628 # [START classroom_new_alias]
@@ -36,13 +38,13 @@ def add_alias_new(self):
3638 try :
3739 course = service .courses ().create (
3840 body = course ).execute ()
39- except :
41+ except errors . HttpError :
4042 print ('Course Creation Failed' )
4143 # [END classroom_new_alias]
4244
4345 def add_alias_existing (self ):
4446 """
45- Adds alias to existing course.
47+ Adds alias to existing course.
4648 """
4749 service = self .service
4850 # [START classroom_existing_alias]
@@ -55,6 +57,6 @@ def add_alias_existing(self):
5557 courseAlias = service .courses ().aliases ().create (
5658 courseId = courseId ,
5759 body = courseAlias ).execute ()
58- except :
60+ except errors . HttpError :
5961 print ('Alias Creation Failed' )
6062 # [END classroom_existing_alias]
You can’t perform that action at this time.
0 commit comments